mem

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

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 New

func New() *Repository

New returns a new empty repository

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

func (repo *Repository) GetComposedSchema(context *ls.Context, id string) (*ls.Layer, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL