Documentation ¶
Index ¶
Constants ¶
View Source
const (
ModelNameEntityOrderer = "EntityOrderer"
)
Variables ¶
This section is empty.
Functions ¶
func NewComponent ¶
func NewEntityMeta ¶
func NewEntityMeta(tableName, primaryName string, where mrstorage.SqlBuilderPart) *entityMeta
Types ¶
type Component ¶
type Component interface { WithMetaData(meta EntityMeta) Component InsertToFirst(ctx context.Context, nodeID mrtype.KeyInt32) error InsertToLast(ctx context.Context, nodeID mrtype.KeyInt32) error MoveToLast(ctx context.Context, nodeID mrtype.KeyInt32) error MoveToFirst(ctx context.Context, nodeID mrtype.KeyInt32) error MoveAfterID(ctx context.Context, nodeID mrtype.KeyInt32, afterNodeID mrtype.KeyInt32) error Unlink(ctx context.Context, nodeID mrtype.KeyInt32) error }
type EntityMeta ¶
type EntityMeta interface { TableName() string PrimaryName() string Where() mrstorage.SqlBuilderPart }
type EntityNode ¶
type EntityNode struct { ID mrtype.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 mrtype.KeyInt32, prevID mrentity.ZeronullInt32) error UpdateNodeNextID(ctx context.Context, id mrtype.KeyInt32, nextID mrentity.ZeronullInt32) error RecalcOrderField(ctx context.Context, minBorder, step int64) error }
Click to show internal directories.
Click to hide internal directories.