Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegistrySchema ¶
func RegistrySchema(g *GroupVersionKind, fn func(Object) Schema)
Types ¶
type GroupVersionKind ¶ added in v0.18.6
GroupVersionKind contains the information of Object, etc Group, Version, Name
func (*GroupVersionKind) String ¶ added in v0.18.6
func (gvk *GroupVersionKind) String() string
type Object ¶
type Object interface {
// APIGroup get the GroupVersionKind of Object
APIGroup() *GroupVersionKind
// DeepCopy deep copy the struct
DeepCopy() Object
}
Object is an interface that describes protocol message
func NewObjWithGVK ¶ added in v0.18.6
func NewObjWithGVK(gvk *GroupVersionKind) (Object, bool)
type ObjectSet ¶ added in v0.18.6
type ObjectSet struct {
sync.RWMutex
OnCreate func(in Object) Object
// contains filtered or unexported fields
}
func NewObjectSet ¶ added in v0.18.6
func NewObjectSet() *ObjectSet
func (*ObjectSet) NewObjWithGVK ¶ added in v0.18.6
func (os *ObjectSet) NewObjWithGVK(gvk *GroupVersionKind) (Object, bool)
type Schema ¶
type Schema interface {
FindPage(ctx context.Context, page, size int) ([]Object, int64, error)
FindAll(ctx context.Context) ([]Object, error)
FindPureAll(ctx context.Context) ([]Object, error)
Count(ctx context.Context) (total int64, err error)
FindOne(ctx context.Context) (Object, error)
Cond(exprs ...clause.Expression) Schema
Create(ctx context.Context) (Object, error)
BatchUpdates(ctx context.Context) error
Updates(ctx context.Context) (Object, error)
BatchDelete(ctx context.Context, soft bool) error
Delete(ctx context.Context, soft bool) error
Tx(ctx context.Context) *dao.DB
}
type SchemaSet ¶
func NewSchemaSet ¶
func NewSchemaSet() *SchemaSet
func (*SchemaSet) RegistrySchema ¶
func (s *SchemaSet) RegistrySchema(g *GroupVersionKind, fn func(Object) Schema)
Click to show internal directories.
Click to hide internal directories.