runtime

package
v1.1.45 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

type Reader interface {
	// Get 获取数据
	Get(ctx context.Context, key string, out any) error
	// List 获取数据列表
	List(ctx context.Context, out any) error
}

Reader 读取器

type Scheme

type Scheme struct {
	// contains filtered or unexported fields
}

Scheme is a structure used for managing type registration and lookup by their kind names. It maintains a bidirectional mapping between kind names (strings) and their corresponding Go types (reflect.Type).

func NewScheme

func NewScheme() *Scheme

NewScheme 创建方案

func (*Scheme) AddKnownTypeWithName

func (s *Scheme) AddKnownTypeWithName(kind string, obj any, keyFunc cache.KeyFunc) error

AddKnownTypeWithName 添加已知类型

func (*Scheme) AddKnownTypes

func (s *Scheme) AddKnownTypes(types ...any) error

AddKnownTypes 添加已知类型

func (*Scheme) AllKnownTypes

func (s *Scheme) AllKnownTypes() map[string]reflect.Type

AllKnownTypes 获取所有已知类型

func (*Scheme) KindKeyFunc

func (s *Scheme) KindKeyFunc(kind string) (cache.KeyFunc, error)

KindKeyFunc 获取类型的键

func (*Scheme) New

func (s *Scheme) New(kind string) (any, error)

New 创建对象

func (*Scheme) ObjectKeyFunc

func (s *Scheme) ObjectKeyFunc(obj any) (cache.KeyFunc, error)

ObjectKeyFunc 获取对象的键

func (*Scheme) ObjectKind

func (s *Scheme) ObjectKind(obj any) (string, error)

ObjectKind 获取对象的类型

func (*Scheme) ObjectsKeyFunc

func (s *Scheme) ObjectsKeyFunc(objs any) (cache.KeyFunc, error)

ObjectsKeyFunc 获取对象的键

func (*Scheme) ObjectsKind

func (s *Scheme) ObjectsKind(objs any) (string, error)

ObjectsKind 获取对象的类型

func (*Scheme) Recognizes

func (s *Scheme) Recognizes(kind string) bool

Recognizes 是否识别类型

type SchemeObject

type SchemeObject interface {
	// KeyFunc 获取对象的键
	KeyFunc(obj interface{}) (string, error)
}

SchemeObject 方案对象

type Writer

type Writer interface {
	// Create 创建数据
	Create(ctx context.Context, object any) error
	// Update 更新数据
	Update(ctx context.Context, object any) error
	// Delete 删除数据
	Delete(ctx context.Context, object any) error
}

Writer 写入器

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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