adapters

package
v0.0.185 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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, checksum string, 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 {

	// Use LoadResource and StoreResource once callbacks can run concurrently.
	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) LoadResource added in v0.0.165

func (m *MockAdapter) LoadResource(key string) ([]byte, bool)

LoadResource and StoreResource synchronize test assertions and setup with callbacks.

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(ctx context.Context, id domain.KindName, checksum string, 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) StoreResource added in v0.0.165

func (m *MockAdapter) StoreResource(key string, value []byte)

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 hashes the object and sends a verify message

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