runtime

package
v0.20.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddObj added in v0.18.6

func AddObj(v ...Object)

func RegistrySchema

func RegistrySchema(g *GroupVersionKind, fn func(Object) Schema)

Types

type GroupVersionKind added in v0.18.6

type GroupVersionKind struct {
	Group   string
	Version string
	Kind    string
}

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 NewObj added in v0.18.6

func NewObj(gvk string) (Object, bool)

NewObj creates a new object, trigger OnCreate function

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) AddObj added in v0.18.6

func (os *ObjectSet) AddObj(v ...Object)

AddObj push objects to Set

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) NewObj added in v0.18.6

func (os *ObjectSet) NewObj(gvk string) (Object, bool)

NewObj creates a new object, trigger OnCreate function

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
}

func NewSchema

func NewSchema(in Object) (Schema, bool)

type SchemaSet

type SchemaSet struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewSchemaSet

func NewSchemaSet() *SchemaSet

func (*SchemaSet) NewSchema

func (s *SchemaSet) NewSchema(in Object) (Schema, bool)

func (*SchemaSet) RegistrySchema

func (s *SchemaSet) RegistrySchema(g *GroupVersionKind, fn func(Object) Schema)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL