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)
- type BaseEntityManager
- func (ctrl *BaseEntityManager) GetStore() boltz.CrudStore
- func (ctrl *BaseEntityManager) ListWithTx(tx *bbolt.Tx, queryString string, resultHandler ListResultHandler) error
- func (ctrl *BaseEntityManager) PreparedListAssociatedWithTx(tx *bbolt.Tx, id, association string, query ast.Query, ...) error
- func (ctrl *BaseEntityManager) PreparedListIndexedWithTx(tx *bbolt.Tx, cursorProvider ast.SetCursorProvider, query ast.Query, ...) error
- func (ctrl *BaseEntityManager) PreparedListWithTx(tx *bbolt.Tx, query ast.Query, resultHandler ListResultHandler) error
- func (handler *BaseEntityManager) ValidateName(db boltz.Db, boltEntity Named) error
- func (handler *BaseEntityManager) ValidateNameOnCreate(ctx boltz.MutateContext, entity interface{}) error
- func (ctrl *BaseEntityManager) ValidateNameOnUpdate(ctx boltz.MutateContext, updatedEntity, existingEntity boltz.Entity, ...) error
- type Entity
- type EntityListResult
- type EntityRetriever
- type ListResultHandler
- type Named
- type QueryMetaData
Constants ¶
View Source
const ( ListLimitMax = 500 ListOffsetMax = 100000 ListLimitDefault = 10 ListOffsetDefault = 0 )
Variables ¶
This section is empty.
Functions ¶
func ToApiError ¶ added in v0.18.0
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 ¶ added in v0.16.45
func (entity *BaseEntity) IsSystemEntity() bool
func (*BaseEntity) SetId ¶
func (entity *BaseEntity) SetId(id string)
type BaseEntityManager ¶ added in v0.18.0
func (*BaseEntityManager) GetStore ¶ added in v0.18.0
func (ctrl *BaseEntityManager) GetStore() boltz.CrudStore
func (*BaseEntityManager) ListWithTx ¶ added in v0.18.0
func (ctrl *BaseEntityManager) ListWithTx(tx *bbolt.Tx, queryString string, resultHandler ListResultHandler) error
func (*BaseEntityManager) PreparedListAssociatedWithTx ¶ added in v0.18.0
func (ctrl *BaseEntityManager) PreparedListAssociatedWithTx(tx *bbolt.Tx, id, association string, query ast.Query, resultHandler ListResultHandler) error
func (*BaseEntityManager) PreparedListIndexedWithTx ¶ added in v0.18.0
func (ctrl *BaseEntityManager) PreparedListIndexedWithTx(tx *bbolt.Tx, cursorProvider ast.SetCursorProvider, query ast.Query, resultHandler ListResultHandler) error
func (*BaseEntityManager) PreparedListWithTx ¶ added in v0.18.0
func (ctrl *BaseEntityManager) PreparedListWithTx(tx *bbolt.Tx, query ast.Query, resultHandler ListResultHandler) error
func (*BaseEntityManager) ValidateName ¶ added in v0.18.0
func (handler *BaseEntityManager) ValidateName(db boltz.Db, boltEntity Named) error
func (*BaseEntityManager) ValidateNameOnCreate ¶ added in v0.18.0
func (handler *BaseEntityManager) ValidateNameOnCreate(ctx boltz.MutateContext, entity interface{}) error
func (*BaseEntityManager) ValidateNameOnUpdate ¶ added in v0.18.0
func (ctrl *BaseEntityManager) ValidateNameOnUpdate(ctx boltz.MutateContext, updatedEntity, existingEntity boltz.Entity, checker boltz.FieldChecker) error
type EntityListResult ¶
type EntityListResult[T Entity] struct { Loader EntityRetriever[T] 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 GetStore() boltz.CrudStore // 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
Click to show internal directories.
Click to hide internal directories.