-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcartridge.go
38 lines (28 loc) · 1.24 KB
/
cartridge.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package commoncartridge
import (
"io/fs"
"github.com/commonsyllabi/commoncartridge/types"
)
type Cartridge interface {
// MarshalJSON returns a serialized JSON representation
MarshalJSON() ([]byte, error)
//-- ParseManifest finds the imsmanifest.xml in the ZipReader and marshals it into a struct
Manifest() (types.Manifest, error)
// Title returns the title of the loaded cartridge
Title() string
// Metadata returns the metadata fields of the cartridge in a structured fashion
Metadata() (string, error)
// Items returns a slice of structs which include the Item, the Resources and the children Items it might have
Items() ([]FullItem, error)
// Resources returns a slice of structs which include the resource and, if found, the item in which the resource appears.
Resources() ([]FullResource, error)
Weblinks() ([]types.WebLink, error)
Assignments() ([]types.Assignment, error)
LTIs() ([]types.CartridgeBasicltiLink, error)
QTIs() ([]types.Questestinterop, error)
Topics() ([]types.Topic, error)
// Find takes an identifier and returns the corresponding resource.
Find(string) (interface{}, error)
// FindFile takes an identifier and returns the fs.File that the corresponding node refers to.
FindFile(string) (fs.File, error)
}