lfs

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

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 Rule

type Rule struct {
	Type   string                 `yaml:"type"`
	Config map[string]interface{} `yaml:"config"`
}

Rule defines a validation to check if a value is valid or not type Entity struct {

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

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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