runtime

package
v0.18.5 Latest Latest
Warning

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

Go to latest
Published: May 30, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegistrySchema

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

Types

type APIGroup

type APIGroup struct {
	Group   string
	Version string
	Name    string
}

APIGroup contains the information of Object, etc Group, Version, Name

func (*APIGroup) String

func (g *APIGroup) String() string

type Object

type Object interface {
	// GetAPIGroup get the APIGroup of Object
	GetAPIGroup() *APIGroup
	// DeepCopy deep copy the struct
	DeepCopy() Object
}

Object is an interface that describes protocol message

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
}

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 *APIGroup, fn func(Object) Schema)

Jump to

Keyboard shortcuts

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