models

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2025 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrObjectPtr       errs.Error = "object must be a pointer to a struct"
	ErrObjectInvalid   errs.Error = "object is invalid or nil, the object must be a valid pointer to a struct"
	ErrModelEmbedded   errs.Error = "object does not have an embedded Model field, the object must embed the Model struct"
	ErrModelAdressable errs.Error = "the Model is not addressable, the object must embed the Model struct"
	ErrModelType       errs.Error = "object has a non- Model type embedded as the Model field, the object must embed the models.Model struct"
)

Variables

View Source
var (
	SIGNAL_MODEL_SETUP = model_signal_pool.Get("models.Model.setup")
)

Functions

This section is empty.

Types

type Model

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

func ExtractModel added in v1.1.0

func ExtractModel(def any) (*Model, error)

func (*Model) Define

func (m *Model) Define(def attrs.Definer, f ...attrs.Field) *attrs.ObjectDefinitions

func (*Model) ModelDataStore

func (m *Model) ModelDataStore() queries.ModelDataStore

func (*Model) ModelMeta

func (m *Model) ModelMeta() attrs.ModelMeta

func (*Model) RelatedField

func (m *Model) RelatedField(name string) (attrs.Field, bool)

func (*Model) SaveFields

func (m *Model) SaveFields() error

type ModelSignal added in v1.1.0

type ModelSignal struct {
	SignalInfo ModelSignalInfo
	Model      *Model
	Object     attrs.Definer
}

type ModelSignalFlag added in v1.1.0

type ModelSignalFlag uint
const (
	ModelSignalFlagNone ModelSignalFlag = 0
	FlagModelReset      ModelSignalFlag = iota
)

type ModelSignalInfo added in v1.1.0

type ModelSignalInfo struct {
	Flags ModelSignalFlag
	Data  map[string]any
}

Jump to

Keyboard shortcuts

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