Documentation ¶
Index ¶
- Constants
- func NewComponent(storage Storage, eventBox mrcore.EventBox) *component
- func NewEntityMeta(tableName string, primaryName string, conds ...any) *entityMeta
- func NewRepository(client mrstorage.DbConn, queryBuilder squirrel.StatementBuilderType) *repository
- type Component
- type EntityMeta
- type EntityNode
- type Storage
Constants ¶
View Source
const ModelNameEntityOrderer = "EntityOrderer"
Variables ¶
This section is empty.
Functions ¶
func NewComponent ¶
func NewEntityMeta ¶
func NewRepository ¶
func NewRepository( client mrstorage.DbConn, queryBuilder squirrel.StatementBuilderType, ) *repository
NewRepository -
Types ¶
type Component ¶
type Component interface { WithMetaData(meta EntityMeta) Component InsertToFirst(ctx context.Context, nodeId mrentity.KeyInt32) error InsertToLast(ctx context.Context, nodeId mrentity.KeyInt32) error MoveToLast(ctx context.Context, nodeId mrentity.KeyInt32) error MoveToFirst(ctx context.Context, nodeId mrentity.KeyInt32) error MoveAfterId(ctx context.Context, nodeId mrentity.KeyInt32, afterNodeId mrentity.KeyInt32) error Unlink(ctx context.Context, nodeId mrentity.KeyInt32) error }
type EntityMeta ¶
type EntityNode ¶
type EntityNode struct { Id mrentity.KeyInt32 PrevId mrentity.ZeronullInt32 NextId mrentity.ZeronullInt32 OrderField mrentity.ZeronullInt64 }
type Storage ¶
type Storage interface { WithMetaData(meta EntityMeta) Storage LoadNode(ctx context.Context, row *EntityNode) error LoadFirstNode(ctx context.Context, row *EntityNode) error LoadLastNode(ctx context.Context, row *EntityNode) error UpdateNode(ctx context.Context, row *EntityNode) error UpdateNodePrevId(ctx context.Context, id mrentity.KeyInt32, prevId mrentity.ZeronullInt32) error UpdateNodeNextId(ctx context.Context, id mrentity.KeyInt32, nextId mrentity.ZeronullInt32) error RecalcOrderField(ctx context.Context, minBorder mrentity.Int64, step mrentity.Int64) error }
Click to show internal directories.
Click to hide internal directories.