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, Kind
func FromGVK ¶ added in v0.18.12
func FromGVK(s string) *GroupVersionKind
func (*GroupVersionKind) APIGroup ¶ added in v0.18.12
func (gvk *GroupVersionKind) APIGroup() string
func (*GroupVersionKind) String ¶ added in v0.18.6
func (gvk *GroupVersionKind) String() string
type Object ¶
type Object interface { // GVK get the GroupVersionKind of Object GVK() *GroupVersionKind // DeepCopyFrom deep copy the struct from another DeepCopyFrom(Object) // 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)
NewObjWithGVK creates a new object, trigger OnCreate function
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) GetObj ¶ added in v0.18.15
func (os *ObjectSet) GetObj(gvk *GroupVersionKind) (Object, bool)
func (*ObjectSet) IsExists ¶ added in v0.18.15
func (os *ObjectSet) IsExists(gvk *GroupVersionKind) bool
func (*ObjectSet) NewObjWithGVK ¶ added in v0.18.6
func (os *ObjectSet) NewObjWithGVK(gvk *GroupVersionKind) (Object, bool)
NewObjWithGVK creates a new object, trigger OnCreate function
type Schema ¶
type Schema interface { FindPage(ctx context.Context, page, size int32) ([]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) FindPureOne(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.