Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMissingValue = errors.New("missing value")
View Source
var ErrNotFound = errors.New("not found")
View Source
var Version = "devel"
set during with build with -ldflags -X 'github.com/srerickson/ocfl-index.Version=v0.0.X'
Functions ¶
This section is empty.
Types ¶
type ContentMeta ¶
type ContentMeta struct { IsDir bool `json:"dir"` // Content is a directory ContentPath string `json:"content_path,omitempty"` // Content path for file Sum string `json:"digest"` // Hex encoded checksum Children []DirEntry `json:"children,omitempty"` // Content of a directory }
ContentMeta represents the indexed logical content of an OCFL object
type ContentResult ¶ added in v0.0.4
type ContentResult struct { // OCFL Object ID ID string `json:"id"` // Version number for content Version ocfl.VNum `json:"version"` // Logical path of content Path string `json:"path"` Content *ContentMeta `json:"content"` }
ContentResult is an index response, suitable for json marshaling
type DirEntry ¶
type DirEntry struct { Name string `json:"name"` // file or directory name IsDir bool `json:"dir"` // entry is a directory }
DirEntry represents an entry in a list of directory contents
type Interface ¶
type Interface interface { Close() error GetSchemaVersion(ctx context.Context) (int, int, error) MigrateSchema(ctx context.Context, erase bool) (bool, error) IndexInventory(ctx context.Context, inv *ocflv1.Inventory) error AllObjects(ctx context.Context) (*ObjectsResult, error) GetVersions(ctx context.Context, objectID string) (*VersionsResult, error) GetContent(ctx context.Context, objectID string, vnum ocfl.VNum, name string) (*ContentResult, error) }
type ObjectMeta ¶
type ObjectMeta struct { ID string `json:"id"` // OCFL Object ID Head ocfl.VNum `json:"head"` // most recent version HeadCreated time.Time `json:"head_created"` // date of most recent version }
ObjectMeta represents indexed OCFL object metadata
type ObjectsResult ¶ added in v0.0.4
type ObjectsResult struct {
Objects []*ObjectMeta `json:"objects"`
}
ObjectsResult is an index response, suitable for json marshaling
type VersionMeta ¶
type VersionMeta struct { Num ocfl.VNum `json:"id"` // Version number Message string `json:"message"` // Version message Created time.Time `json:"created"` // Version create datetime User *ocflv1.User `json:"user,omitempty"` // Version user information }
VersionMeta represents indexed OCFL object version metadata
type VersionsResult ¶ added in v0.0.4
type VersionsResult struct { // OCFL Object ID ID string `json:"id"` Versions []*VersionMeta `json:"versions"` }
VersionsResult is an index response, suitable for json marshaling
Click to show internal directories.
Click to hide internal directories.