Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entity ¶
type Entity struct { ID string `yaml:"id"` Name string `yaml:"name"` SingularName string `yaml:"singular_name"` PluralName string `yaml:"plural_name"` Fields []Field `yaml:"fields"` Collection string `yaml:"collection"` }
Entity is a specific definition of an object/entity/thing inside a domain in yaml specification
type EntityMarshaler ¶
type EntityMarshaler interface { // UnmarshalEntity decodes a yaml entity model to a domain entity model UnmarshalEntity(*Entity) (*pubdomain.Entity, error) }
EntityMarshaler decodes/encodes domain entity model from/to yaml entity model
func NewEntityMarshaler ¶
func NewEntityMarshaler() EntityMarshaler
NewEntityMarshaler returns a new instance of EntityMarshaler
type Field ¶
type Field struct { Type string `yaml:"type"` Name string `yaml:"name"` Label string `yaml:"label"` Rules []Rule `yaml:"rules"` }
Field defines a representation for every field of an entity in yaml specification
type Knowledge ¶
type Knowledge struct {
Entities []Entity `yaml:"entities"`
}
Knowledge contains the entire list of entities that represents a knowledge or domain
type LocalEntityRepository ¶
type LocalEntityRepository struct {
// contains filtered or unexported fields
}
LocalEntityRepository is the repository to manage entities in the local file system Useful for quick testing and prototyping
func NewLocalEntityRepository ¶
func NewLocalEntityRepository( entityMarshaler EntityMarshaler, filer filesystem.Filer, path string, yamlMarshaler YamlMarshaler, ) (*LocalEntityRepository, error)
NewLocalEntityRepository creates a new instance of LocalEntityRepository
func (*LocalEntityRepository) GetEntityByName ¶
func (repo *LocalEntityRepository) GetEntityByName( ctx context.Context, entityName string, ) (*pubdomain.Entity, error)
GetEntityByName returns one single entity defined by its name
type YamlMarshaler ¶
type YamlMarshaler interface { // Unmarshal decodes yaml content // and assigns decoded values into output Unmarshal([]byte, interface{}) error }
YamlMarshaler decodes/encodes yaml content from/to outputs
func NewYamlMarshaler ¶
func NewYamlMarshaler() YamlMarshaler
NewYamlMarshaler creates a new instance NewYamlMarshaler