Documentation ¶
Index ¶
- type Repository
- func (repo *Repository) AddLayer(layer *ls.Layer)
- func (repo *Repository) GetComposedSchema(context *ls.Context, id string) (*ls.Layer, error)
- func (repo *Repository) GetLayer(id string) *ls.Layer
- func (repo *Repository) GetLayers() []*ls.Layer
- func (repo *Repository) GetOverlay(id string) *ls.Layer
- func (repo *Repository) GetSchema(id string) *ls.Layer
- func (repo *Repository) ParseAddIntf(m interface{}) (interface{}, error)
- func (repo *Repository) ParseAddObject(in []byte) (interface{}, error)
- func (repo *Repository) RemoveObject(ID string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository is an in-memory schema repository. It keeps all parsed schemas and schema variants
func (*Repository) AddLayer ¶
func (repo *Repository) AddLayer(layer *ls.Layer)
AddLayer adds a new schema or overlay to the repo. If there is one with the same id, the new layer replaces the old one
func (*Repository) GetComposedSchema ¶
GetComposedSchema returns a composed layer from the schema variant
func (*Repository) GetLayer ¶
func (repo *Repository) GetLayer(id string) *ls.Layer
GetLayer returns a schema or an overlay with the given id
func (*Repository) GetLayers ¶
func (repo *Repository) GetLayers() []*ls.Layer
GetLayers returns layers in the repository
func (*Repository) GetOverlay ¶
func (repo *Repository) GetOverlay(id string) *ls.Layer
GetOverlay returns an overlay with the given id
func (*Repository) GetSchema ¶
func (repo *Repository) GetSchema(id string) *ls.Layer
GetSchema returns a schema with the given id
func (*Repository) ParseAddIntf ¶
func (repo *Repository) ParseAddIntf(m interface{}) (interface{}, error)
ParseAddIntf parses and adds the unmarshaled object
func (*Repository) ParseAddObject ¶
func (repo *Repository) ParseAddObject(in []byte) (interface{}, error)
ParseAddObject parses the given layer or schema variant and adds it to the repository. Returns the parsed object
func (*Repository) RemoveObject ¶
func (repo *Repository) RemoveObject(ID string)
RemoveObject removes the object(s) with the given id