model

package
v1.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: GPL-3.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrApply = errors.New("")
View Source
var ErrInvalidEmbedded = errors.New("invalid embedded")

ErrInvalidEmbedded represent an error where ....

View Source
var ErrModel = errors.New("")
View Source
var ErrStructNode = errors.New("")
View Source
var ErrUninitializedKey = errors.New("uninitialized key")

ErrUninitializedKey represent an error where ....

Functions

This section is empty.

Types

type ApplyError

type ApplyError struct {
	merror.MError
}

func (ApplyError) Is

func (ApplyError) Is(err error) bool

type FieldNameCollisionError

type FieldNameCollisionError struct {
	Path1 string
	Path2 string
}

func (FieldNameCollisionError) Error

func (u FieldNameCollisionError) Error() string

type GetList

type GetList []GetOp

func (GetList) ApplyOn

func (s GetList) ApplyOn(g internal.Getter) (fvalue.Values, error)

func (*GetList) Count

func (s *GetList) Count() int

func (*GetList) Push

func (s *GetList) Push(o GetOp)

type GetListInterface

type GetListInterface interface {
	ApplyOn(g internal.Getter) (fvalue.Values, error)
	Push(o GetOp)
	Count() int
}

type GetOp

type GetOp func(g internal.Getter) (
	uid uint,
	fieldValue *fvalue.Value,
	err error,
)

type IndexedSubNode

type IndexedSubNode struct {
	Node  Node
	Index []int
}

type IndexedSubNodes

type IndexedSubNodes []*IndexedSubNode

func (IndexedSubNodes) GetIndexes

func (i IndexedSubNodes) GetIndexes() [][]int

type Model

type Model struct {
	// contains filtered or unexported fields
}

func NewModel

func NewModel(inputModelType reflect.Type) (*Model, error)

func (*Model) ApplyOn

func (m *Model) ApplyOn(g internal.Getter) (fvalue.Values, error)

func (*Model) Fill

func (m *Model) Fill(
	inputModelValue reflect.Value,
	layers []fvalue.Values,
) (plocation.Locations, error)

func (*Model) GetFieldValuesFor

func (m *Model) GetFieldValuesFor(
	id string,
	value reflect.Value,
) fvalue.Values

func (*Model) TypeName

func (m *Model) TypeName() string

type ModelError

type ModelError struct {
	merror.MError
}

func (ModelError) Is

func (ModelError) Is(err error) bool

type Node

type Node interface {
	BuildGetList(s *GetList)
	FeedFieldValues(
		srcID string,
		fieldValues fvalue.Values,
		value reflect.Value,
	)
	Fill(
		value reflect.Value,
		layers []fvalue.Values,
	) (plocation.Locations, error)
}

type StructNode

type StructNode struct {
	Type  reflect.Type
	Index IndexedSubNodes
}

func (*StructNode) BuildGetList

func (n *StructNode) BuildGetList(s *GetList)

func (*StructNode) FeedFieldValues

func (n *StructNode) FeedFieldValues(
	srcID string,
	fieldValues fvalue.Values,
	value reflect.Value,
)

func (StructNode) Fill

func (n StructNode) Fill(
	value reflect.Value, layers []fvalue.Values,
) (plocation.Locations, error)

func (*StructNode) PushSubNodes

func (n *StructNode) PushSubNodes(index []int, scanned Node)

type StructNodeError

type StructNodeError struct {
	merror.MError
}

func (StructNodeError) Is

func (StructNodeError) Is(err error) bool

type UnsupportedTypeError

type UnsupportedTypeError struct {
	Type reflect.Type
	Path string
}

func (UnsupportedTypeError) Error

func (u UnsupportedTypeError) Error() string

type ValueNode

type ValueNode struct {
	Type        reflect.Type
	VisiblePath string
	UID         uint
}

func (*ValueNode) BuildGetList

func (n *ValueNode) BuildGetList(s *GetList)

func (*ValueNode) FeedFieldValues

func (n *ValueNode) FeedFieldValues(
	srcID string,
	fieldValues fvalue.Values,
	value reflect.Value,
)

func (*ValueNode) Fill

func (n *ValueNode) Fill(
	value reflect.Value, layers []fvalue.Values,
) (plocation.Locations, error)

Jump to

Keyboard shortcuts

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