Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRepo ¶ added in v0.22.6
func RegisterRepo(g *GroupVersionKind, fn func(Entity) Repo)
Types ¶
type Entity ¶ added in v0.22.6
type Entity interface { // GVK get the GroupVersionKind of Entity GVK() *GroupVersionKind // DeepCopyFrom deep copy the struct from another DeepCopyFrom(Entity) // DeepCopy deep copy the struct DeepCopy() Entity }
Entity is an interface that describes protocol message
func NewEntWithGVK ¶ added in v0.22.6
func NewEntWithGVK(gvk *GroupVersionKind) (Entity, bool)
NewEntWithGVK creates a new entity, trigger OnCreate function
type EntitySet ¶ added in v0.22.6
type EntitySet struct { sync.RWMutex OnCreate func(in Entity) Entity // contains filtered or unexported fields }
func NewEntitySet ¶ added in v0.22.6
func NewEntitySet() *EntitySet
func (*EntitySet) GetEntity ¶ added in v0.22.6
func (os *EntitySet) GetEntity(gvk *GroupVersionKind) (Entity, bool)
func (*EntitySet) IsExists ¶ added in v0.22.6
func (os *EntitySet) IsExists(gvk *GroupVersionKind) bool
func (*EntitySet) NewEntWithGVK ¶ added in v0.22.6
func (os *EntitySet) NewEntWithGVK(gvk *GroupVersionKind) (Entity, bool)
NewEntWithGVK creates a new entity, trigger OnCreate function
type GroupVersionKind ¶
GroupVersionKind contains the information of Entity, etc Group, Version, Kind
func FromGVK ¶
func FromGVK(s string) *GroupVersionKind
func (*GroupVersionKind) APIGroup ¶
func (gvk *GroupVersionKind) APIGroup() string
func (*GroupVersionKind) String ¶
func (gvk *GroupVersionKind) String() string
type Repo ¶ added in v0.22.6
type Repo interface { FindPage(ctx context.Context, page, size int32) ([]Entity, int64, error) FindAll(ctx context.Context) ([]Entity, error) FindPureAll(ctx context.Context) ([]Entity, error) Count(ctx context.Context) (total int64, err error) FindOne(ctx context.Context) (Entity, error) FindPureOne(ctx context.Context) (Entity, error) Cond(exprs ...clause.Expression) Repo Create(ctx context.Context) (Entity, error) BatchUpdates(ctx context.Context) error Updates(ctx context.Context) (Entity, error) BatchDelete(ctx context.Context, soft bool) error Delete(ctx context.Context, soft bool) error Tx(ctx context.Context) *dao.DB }
type RepoSet ¶ added in v0.22.6
func NewRepoSet ¶ added in v0.22.6
func NewRepoSet() *RepoSet
func (*RepoSet) RegisterRepo ¶ added in v0.22.6
func (s *RepoSet) RegisterRepo(g *GroupVersionKind, fn func(Entity) Repo)
Click to show internal directories.
Click to hide internal directories.