Documentation
¶
Index ¶
- Variables
- type ErrNotFound
- type IndexEntry
- type Repository
- func (repo *Repository) BuildIndex() ([]IndexEntry, []string, error)
- func (repo *Repository) GetComposedSchema(context *ls.Context, id string) (*ls.Layer, error)
- func (repo *Repository) GetComposedSchemaByObjectType(context *ls.Context, t string) (*ls.Layer, error)
- func (repo *Repository) GetLayer(id string) *ls.Layer
- func (repo *Repository) GetOverlay(id string) *ls.Layer
- func (repo *Repository) GetSchema(id string) *ls.Layer
- func (repo *Repository) IsIndexStale() bool
- func (repo *Repository) Load() error
- func (repo *Repository) LoadAndCompose(context *ls.Context, id string) (*ls.Layer, error)
- func (repo *Repository) UpdateIndex() ([]string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBadIndex = errors.New("Bad index file")
View Source
var ErrNoIndex = errors.New("No index file")
Functions ¶
This section is empty.
Types ¶
type ErrNotFound ¶
type ErrNotFound string
func (ErrNotFound) Error ¶
func (e ErrNotFound) Error() string
type IndexEntry ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository implements a filesystem based schema repository under a given directory
func New ¶
func New(root string) *Repository
New returns a new file repository under the given directory.
func NewWithInterner ¶
func NewWithInterner(root string, interner ls.Interner) *Repository
NewWithInterner returns a new file repository under the given directory.
func (*Repository) BuildIndex ¶
func (repo *Repository) BuildIndex() ([]IndexEntry, []string, error)
BuildIndex reads and parses all jsonld files and returns the index entries
func (*Repository) GetComposedSchema ¶
func (*Repository) GetComposedSchemaByObjectType ¶
func (*Repository) GetOverlay ¶
func (repo *Repository) GetOverlay(id string) *ls.Layer
func (*Repository) IsIndexStale ¶
func (repo *Repository) IsIndexStale() bool
IsIndexStale returns true if the index needs to be rebuilt
func (*Repository) Load ¶
func (repo *Repository) Load() error
Load loads the index under the directory.
func (*Repository) LoadAndCompose ¶
LoadAndCompose loads the layer or schema variant with the given ID. If the loaded object is a schema variant, computes the composite schema and returns it.
func (*Repository) UpdateIndex ¶
func (repo *Repository) UpdateIndex() ([]string, error)
UpdateIndex builds and updates the index file
Click to show internal directories.
Click to hide internal directories.