Documentation ¶
Index ¶
- Constants
- func ToApiError(err error) *errorz.ApiError
- type BaseEntity
- func (entity *BaseEntity) FillCommon(boltEntity boltz.ExtEntity)
- func (entity *BaseEntity) GetCreatedAt() time.Time
- func (entity *BaseEntity) GetId() string
- func (entity *BaseEntity) GetTags() map[string]interface{}
- func (entity *BaseEntity) GetUpdatedAt() time.Time
- func (entity *BaseEntity) IsSystemEntity() bool
- func (entity *BaseEntity) SetId(id string)
- func (entity *BaseEntity) ToBoltBaseExtEntity() *boltz.BaseExtEntity
- type BaseEntityManager
- func (ctrl *BaseEntityManager[E]) GetListStore() boltz.Store
- func (ctrl *BaseEntityManager[E]) GetStore() boltz.EntityStore[E]
- func (ctrl *BaseEntityManager[E]) ListWithTx(tx *bbolt.Tx, queryString string, resultHandler ListResultHandler) error
- func (ctrl *BaseEntityManager[E]) PreparedListAssociatedWithTx(tx *bbolt.Tx, id, association string, query ast.Query, ...) error
- func (ctrl *BaseEntityManager[E]) PreparedListIndexedWithTx(tx *bbolt.Tx, cursorProvider ast.SetCursorProvider, query ast.Query, ...) error
- func (ctrl *BaseEntityManager[E]) PreparedListWithTx(tx *bbolt.Tx, query ast.Query, resultHandler ListResultHandler) error
- func (handler *BaseEntityManager[E]) ValidateName(db boltz.Db, boltEntity Named) error
- func (handler *BaseEntityManager[E]) ValidateNameOnCreate(tx *bbolt.Tx, entity interface{}) error
- func (ctrl *BaseEntityManager[E]) ValidateNameOnUpdate(ctx boltz.MutateContext, updatedEntity, existingEntity boltz.Entity, ...) error
- type Entity
- type EntityListResult
- type EntityRetriever
- type ListResultHandler
- type NameIndexedStore
- type Named
- type QueryMetaData
Constants ¶
View Source
const ( ListLimitMax = 500 ListOffsetMax = 100000 ListLimitDefault = 10 ListOffsetDefault = 0 )
Variables ¶
This section is empty.
Functions ¶
func ToApiError ¶
Types ¶
type BaseEntity ¶
type BaseEntity struct { Id string CreatedAt time.Time UpdatedAt time.Time Tags map[string]interface{} IsSystem bool }
func (*BaseEntity) FillCommon ¶
func (entity *BaseEntity) FillCommon(boltEntity boltz.ExtEntity)
func (*BaseEntity) GetCreatedAt ¶
func (entity *BaseEntity) GetCreatedAt() time.Time
func (*BaseEntity) GetId ¶
func (entity *BaseEntity) GetId() string
func (*BaseEntity) GetTags ¶
func (entity *BaseEntity) GetTags() map[string]interface{}
func (*BaseEntity) GetUpdatedAt ¶
func (entity *BaseEntity) GetUpdatedAt() time.Time
func (*BaseEntity) IsSystemEntity ¶
func (entity *BaseEntity) IsSystemEntity() bool
func (*BaseEntity) SetId ¶
func (entity *BaseEntity) SetId(id string)
func (*BaseEntity) ToBoltBaseExtEntity ¶
func (entity *BaseEntity) ToBoltBaseExtEntity() *boltz.BaseExtEntity
type BaseEntityManager ¶
type BaseEntityManager[E boltz.ExtEntity] struct { Store boltz.EntityStore[E] }
func (*BaseEntityManager[E]) GetListStore ¶
func (ctrl *BaseEntityManager[E]) GetListStore() boltz.Store
func (*BaseEntityManager[E]) GetStore ¶
func (ctrl *BaseEntityManager[E]) GetStore() boltz.EntityStore[E]
func (*BaseEntityManager[E]) ListWithTx ¶
func (ctrl *BaseEntityManager[E]) ListWithTx(tx *bbolt.Tx, queryString string, resultHandler ListResultHandler) error
func (*BaseEntityManager[E]) PreparedListAssociatedWithTx ¶
func (ctrl *BaseEntityManager[E]) PreparedListAssociatedWithTx(tx *bbolt.Tx, id, association string, query ast.Query, resultHandler ListResultHandler) error
func (*BaseEntityManager[E]) PreparedListIndexedWithTx ¶
func (ctrl *BaseEntityManager[E]) PreparedListIndexedWithTx(tx *bbolt.Tx, cursorProvider ast.SetCursorProvider, query ast.Query, resultHandler ListResultHandler) error
func (*BaseEntityManager[E]) PreparedListWithTx ¶
func (ctrl *BaseEntityManager[E]) PreparedListWithTx(tx *bbolt.Tx, query ast.Query, resultHandler ListResultHandler) error
func (*BaseEntityManager[E]) ValidateName ¶
func (handler *BaseEntityManager[E]) ValidateName(db boltz.Db, boltEntity Named) error
func (*BaseEntityManager[E]) ValidateNameOnCreate ¶
func (handler *BaseEntityManager[E]) ValidateNameOnCreate(tx *bbolt.Tx, entity interface{}) error
func (*BaseEntityManager[E]) ValidateNameOnUpdate ¶
func (ctrl *BaseEntityManager[E]) ValidateNameOnUpdate(ctx boltz.MutateContext, updatedEntity, existingEntity boltz.Entity, checker boltz.FieldChecker) error
type EntityListResult ¶
type EntityListResult[T Entity] struct { Loader interface { BaseLoadInTx(tx *bbolt.Tx, id string) (T, error) } Entities []T QueryMetaData }
func (*EntityListResult[T]) Collect ¶
func (result *EntityListResult[T]) Collect(tx *bbolt.Tx, ids []string, queryMetaData *QueryMetaData) error
func (*EntityListResult[T]) GetEntities ¶
func (result *EntityListResult[T]) GetEntities() []T
func (*EntityListResult[T]) GetMetaData ¶
func (result *EntityListResult[T]) GetMetaData() *QueryMetaData
type EntityRetriever ¶
type EntityRetriever[T Entity] interface { BaseLoad(id string) (T, error) BaseLoadInTx(tx *bbolt.Tx, id string) (T, error) BaseList(query string) (*EntityListResult[T], error) BasePreparedList(query ast.Query) (*EntityListResult[T], error) ListWithHandler(query string, handler ListResultHandler) error PreparedListWithHandler(query ast.Query, handler ListResultHandler) error PreparedListAssociatedWithHandler(id string, association string, query ast.Query, handler ListResultHandler) error GetListStore() boltz.Store // GetEntityTypeId returns a unique id for the entity type. Some entities may share a storage type, such // as fabric and edge services, and fabric and edge routers. However, they should have distinct entity type // ids, so we can figure out to which controller to route commands GetEntityTypeId() string }
type ListResultHandler ¶
type ListResultHandler func(tx *bbolt.Tx, ids []string, qmd *QueryMetaData) error
type NameIndexedStore ¶
Click to show internal directories.
Click to hide internal directories.