Documentation ¶
Index ¶
- Variables
- func CellIsLazy(cell *Cell) bool
- func NewLazyCollection(extractor func() *Collection, afterInit func(collection *Collection)) *lazyCollection
- func NewLazyWrappedEntity(extractor func() *Collection, afterInit func(entity *Cell)) *lazyEntity
- type Box
- type Cell
- type Collection
- func (c *Collection) Add(el interface{})
- func (c *Collection) Count() int
- func (c *Collection) DeepCopy() interface{}
- func (c *Collection) Empty() bool
- func (c *Collection) Get(index int) interface{}
- func (c *Collection) MakeIter() *iterator
- func (c *Collection) Remove(index int)
- func (c *Collection) ToSlice() []interface{}
- type Copiable
- type Copier
- type D3Entity
- type DeleteStrategy
- type FieldComparator
- type FieldExtractor
- type FieldInfo
- type FieldSetter
- type Index
- type Instantiator
- type InternalTools
- type KeyTpl
- type LazyContainer
- type ManyToMany
- type ManyToOne
- type ManyToOneInverse
- type MetaInfo
- func (m *MetaInfo) CreateKeyTpl() *KeyTpl
- func (m *MetaInfo) Deps() []Name
- func (m *MetaInfo) ExtractPkValue(entity interface{}) (interface{}, error)
- func (m *MetaInfo) FindRelativeMetaRecursive(entityName Name) (*MetaInfo, bool)
- func (m *MetaInfo) FullColumnAlias(colName string) string
- func (m *MetaInfo) ManyToManyRelations() []*ManyToMany
- func (m *MetaInfo) OneToManyRelations() []*OneToMany
- func (m *MetaInfo) OneToOneRelations() []*OneToOne
- type MetaRegistry
- type MetaToken
- type Name
- type OneToMany
- type OneToOne
- type PkStrategy
- type Relation
- type RelationType
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidType = errors.New("invalid type, must be struct or pointer to struct")
)
Functions ¶
func CellIsLazy ¶
func NewLazyCollection ¶
func NewLazyCollection(extractor func() *Collection, afterInit func(collection *Collection)) *lazyCollection
func NewLazyWrappedEntity ¶
func NewLazyWrappedEntity(extractor func() *Collection, afterInit func(entity *Cell)) *lazyEntity
Types ¶
type Cell ¶
type Cell struct {
// contains filtered or unexported fields
}
Cell - d3 container for single entity.
func NewCellFromWrapper ¶
func NewCellFromWrapper(w wrapper) *Cell
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
Collection - d3 container for multiple entities of same type.
func NewCollection ¶
func NewCollection(entities ...interface{}) *Collection
NewCollection - create new collection of entities.
func NewCollectionFromCollectionner ¶
func NewCollectionFromCollectionner(c collectionner) *Collection
func (*Collection) Count ¶
func (c *Collection) Count() int
count - return count of elements in collection.
func (*Collection) DeepCopy ¶
func (c *Collection) DeepCopy() interface{}
func (*Collection) Empty ¶
func (c *Collection) Empty() bool
empty - return true if collection has 0 entities, false otherwise.
func (*Collection) Get ¶
func (c *Collection) Get(index int) interface{}
get - get element from collection by index.
func (*Collection) MakeIter ¶
func (c *Collection) MakeIter() *iterator
MakeIter - creates structure for iterate over collection.
func (*Collection) Remove ¶
func (c *Collection) Remove(index int)
remove - delete element from collection by index.
func (*Collection) ToSlice ¶
func (c *Collection) ToSlice() []interface{}
toSlice - return slice of entities.
type FieldComparator ¶
type FieldExtractor ¶
type FieldSetter ¶
type Instantiator ¶
type Instantiator func() interface{}
type InternalTools ¶
type InternalTools struct { ExtractField FieldExtractor SetFieldVal FieldSetter NewInstance Instantiator Copy Copier CompareFields FieldComparator }
type KeyTpl ¶
type KeyTpl struct {
// contains filtered or unexported fields
}
func (*KeyTpl) Projection ¶
func (k *KeyTpl) Projection() []interface{}
type LazyContainer ¶
type LazyContainer interface {
IsInitialized() bool
}
type ManyToMany ¶
type ManyToMany struct { JoinColumn string ReferenceColumn string JoinTable string // contains filtered or unexported fields }
func (*ManyToMany) DeleteStrategy ¶
func (b *ManyToMany) DeleteStrategy() DeleteStrategy
func (*ManyToMany) ExtractCollection ¶
func (m *ManyToMany) ExtractCollection(ownerBox *Box) (*Collection, error)
func (*ManyToMany) RelatedWith ¶
func (b *ManyToMany) RelatedWith() Name
func (*ManyToMany) Type ¶
func (b *ManyToMany) Type() RelationType
type ManyToOne ¶
type ManyToOne struct { JoinColumn string ReferenceColumn string // contains filtered or unexported fields }
func (*ManyToOne) DeleteStrategy ¶
func (b *ManyToOne) DeleteStrategy() DeleteStrategy
func (*ManyToOne) RelatedWith ¶
func (b *ManyToOne) RelatedWith() Name
func (*ManyToOne) Type ¶
func (b *ManyToOne) Type() RelationType
type ManyToOneInverse ¶
type ManyToOneInverse struct { MappedBy string // contains filtered or unexported fields }
func (*ManyToOneInverse) DeleteStrategy ¶
func (b *ManyToOneInverse) DeleteStrategy() DeleteStrategy
func (*ManyToOneInverse) RelatedWith ¶
func (b *ManyToOneInverse) RelatedWith() Name
func (*ManyToOneInverse) Type ¶
func (b *ManyToOneInverse) Type() RelationType
type MetaInfo ¶
type MetaInfo struct { Tpl interface{} EntityName Name TableName string Indexes []Index Relations map[string]Relation Fields map[string]*FieldInfo Pk *pk RelatedMeta map[Name]*MetaInfo Tools InternalTools }
func (*MetaInfo) CreateKeyTpl ¶
func (*MetaInfo) ExtractPkValue ¶
func (*MetaInfo) FindRelativeMetaRecursive ¶
func (*MetaInfo) FullColumnAlias ¶
func (*MetaInfo) ManyToManyRelations ¶
func (m *MetaInfo) ManyToManyRelations() []*ManyToMany
func (*MetaInfo) OneToManyRelations ¶
func (*MetaInfo) OneToOneRelations ¶
type MetaRegistry ¶
type MetaRegistry struct {
// contains filtered or unexported fields
}
func NewMetaRegistry ¶
func NewMetaRegistry() *MetaRegistry
func (*MetaRegistry) Add ¶
func (r *MetaRegistry) Add(entities ...interface{}) error
func (*MetaRegistry) GetMeta ¶
func (r *MetaRegistry) GetMeta(entity interface{}) (MetaInfo, error)
func (*MetaRegistry) GetMetaByName ¶
func (r *MetaRegistry) GetMetaByName(entityName Name) (MetaInfo, error)
type MetaToken ¶
type MetaToken struct { Tools InternalTools Tpl interface{} TableName string Indexes []Index }
type OneToMany ¶
type OneToMany struct { JoinColumn string ReferenceColumn string // contains filtered or unexported fields }
func (*OneToMany) DeleteStrategy ¶
func (b *OneToMany) DeleteStrategy() DeleteStrategy
func (*OneToMany) ExtractCollection ¶
func (o *OneToMany) ExtractCollection(ownerBox *Box) (*Collection, error)
func (*OneToMany) RelatedWith ¶
func (b *OneToMany) RelatedWith() Name
func (*OneToMany) Type ¶
func (b *OneToMany) Type() RelationType
type OneToOne ¶
type OneToOne struct { JoinColumn string ReferenceColumn string // contains filtered or unexported fields }
func (*OneToOne) DeleteStrategy ¶
func (b *OneToOne) DeleteStrategy() DeleteStrategy
func (*OneToOne) RelatedWith ¶
func (b *OneToOne) RelatedWith() Name
func (*OneToOne) Type ¶
func (b *OneToOne) Type() RelationType
type Relation ¶
type Relation interface { Type() RelationType DeleteStrategy() DeleteStrategy RelatedWith() Name Field() *FieldInfo // contains filtered or unexported methods }
Click to show internal directories.
Click to hide internal directories.