imitator

package
v1.17.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 20 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultV2Client = newV2Client()

DefaultV2Client is the only one client. Because of v2Client maintainers the revision and message cache(todo), so we do not see there are multi-clients.

Functions

func StorageInit

func StorageInit()

StorageInit must be called before using imitator storage (run metaserver or metamanager)

Types

type Client

type Client interface {
	// This set of functions is for metamanager
	// Inject the msg to the backend storage
	Inject(msg model.Message)
	InsertOrUpdateObj(ctx context.Context, obj runtime.Object) error
	DeleteObj(ctx context.Context, obj runtime.Object) error
	InsertOrUpdatePassThroughObj(ctx context.Context, obj []byte, key string) error
	GetPassThroughObj(ctx context.Context, key string) ([]byte, error)

	GetRevision() uint64
	SetRevision(version interface{})

	// This set of functions for upper storage
	List(ctx context.Context, key string) (Resp, error)
	Get(ctx context.Context, key string) (Resp, error)
	Watch(ctx context.Context, key string, ResourceVersion uint64) <-chan watch.Event
}

type Resp

type Resp struct {
	//TODO: change to []*MetaV2
	Kvs *[]v2.MetaV2
	// synonymous with resource version
	Revision uint64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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