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 ¶
GroupVersionKind contains the information of Object, 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 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 ¶
func NewObjWithGVK(gvk *GroupVersionKind) (Object, bool)
NewObjWithGVK creates a new object, trigger OnCreate function
type ObjectSet ¶
type ObjectSet struct { sync.RWMutex OnCreate func(in Object) Object // contains filtered or unexported fields }
func NewObjectSet ¶
func NewObjectSet() *ObjectSet
func (*ObjectSet) IsExists ¶
func (os *ObjectSet) IsExists(gvk *GroupVersionKind) bool
func (*ObjectSet) NewObjWithGVK ¶
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.