runtime

package
v1.1.26 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 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(ctx context.Context, key string, out any) error
	List(ctx context.Context, out any) error
}

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

func (*Scheme) AddKnownTypeWithName

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

func (*Scheme) AddKnownTypes

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

func (*Scheme) AllKnownTypes

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

AllKnownTypes returns the all known types.

func (*Scheme) KindKeyFunc

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

func (*Scheme) New

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

func (*Scheme) ObjectKeyFunc

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

func (*Scheme) ObjectKind

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

func (*Scheme) ObjectsKeyFunc

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

func (*Scheme) ObjectsKind

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

func (*Scheme) Recognizes

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

type SchemeObject

type SchemeObject interface {
	KeyFunc(obj interface{}) (string, error)
}

type Writer

type Writer interface {
	Create(ctx context.Context, object any) error
	Update(ctx context.Context, object any) error
	Delete(ctx context.Context, object any) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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