adapters

package
v0.0.72 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
	IsRelated(ctx context.Context, id domain.ClientIdentifier) bool
	RegisterCallbacks(ctx context.Context, callbacks domain.Callbacks)
	Callbacks(ctx context.Context) (domain.Callbacks, error) // returns the callbacks for the given context
	DeleteObject(ctx context.Context, id domain.KindName) error
	GetObject(ctx context.Context, id domain.KindName, baseObject []byte) error
	PatchObject(ctx context.Context, id domain.KindName, checksum string, patch []byte) error
	PutObject(ctx context.Context, id domain.KindName, object []byte) error
	VerifyObject(ctx context.Context, id domain.KindName, checksum string) error
	Batch(ctx context.Context, id domain.Kind, batchType domain.BatchType, items domain.BatchItems) error
}

type Client

type Client Adapter

type MockAdapter

type MockAdapter struct {
	Resources map[string][]byte
	// contains filtered or unexported fields
}

func NewMockAdapter

func NewMockAdapter(isClient bool) *MockAdapter

func (*MockAdapter) Batch added in v0.0.47

func (m *MockAdapter) Batch(ctx context.Context, kind domain.Kind, _ domain.BatchType, items domain.BatchItems) error

func (*MockAdapter) Callbacks added in v0.0.5

func (m *MockAdapter) Callbacks(_ context.Context) (domain.Callbacks, error)

func (*MockAdapter) DeleteObject

func (m *MockAdapter) DeleteObject(_ context.Context, id domain.KindName) error

func (*MockAdapter) GetObject

func (m *MockAdapter) GetObject(ctx context.Context, id domain.KindName, baseObject []byte) error

func (*MockAdapter) IsRelated added in v0.0.38

func (m *MockAdapter) IsRelated(ctx context.Context, id domain.ClientIdentifier) bool

func (*MockAdapter) PatchObject

func (m *MockAdapter) PatchObject(ctx context.Context, id domain.KindName, checksum string, patch []byte) error

func (*MockAdapter) PutObject

func (m *MockAdapter) PutObject(_ context.Context, id domain.KindName, object []byte) error

func (*MockAdapter) RegisterCallbacks

func (m *MockAdapter) RegisterCallbacks(_ context.Context, callbacks domain.Callbacks)

func (*MockAdapter) Start

func (m *MockAdapter) Start(_ context.Context) error

func (*MockAdapter) Stop added in v0.0.38

func (m *MockAdapter) Stop(_ context.Context) error

func (*MockAdapter) TestCallDeleteObject added in v0.0.17

func (m *MockAdapter) TestCallDeleteObject(ctx context.Context, id domain.KindName) error

TestCallDeleteObject is used for testing purposes only, it is similar to incluster.client response to watch.Deleted event

func (*MockAdapter) TestCallPutOrPatch added in v0.0.17

func (m *MockAdapter) TestCallPutOrPatch(ctx context.Context, id domain.KindName, baseObject []byte, newObject []byte) error

TestCallPutOrPatch is used for testing purposes only, it is similar to incluster.client.callPutOrPatch

func (*MockAdapter) TestCallVerifyObject added in v0.0.17

func (m *MockAdapter) TestCallVerifyObject(ctx context.Context, id domain.KindName, object []byte) error

TestCallVerifyObject is used for testing purposes only, it is similar to incluster.client.callVerifyObject

func (*MockAdapter) VerifyObject

func (m *MockAdapter) VerifyObject(ctx context.Context, id domain.KindName, newChecksum string) error

Directories

Path Synopsis
backend
v1
httpendpoint
v1
incluster
v1

Jump to

Keyboard shortcuts

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