common

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PtrBool

func PtrBool(b bool) *bool

func PtrInt64

func PtrInt64(i int64) *int64

func PtrString

func PtrString(s string) *string

func WriteHexDump added in v0.5.0

func WriteHexDump(out io.Writer, buffer []byte)

func WriteOutput added in v0.5.0

func WriteOutput(out io.Writer, value any)

Types

type ClientConfig

type ClientConfig struct {
	ServiceAddr    string
	Namespace      string
	RequestTimeout time.Duration
}

func (ClientConfig) NewClient

func (ClientConfig) NewClient() (oxia.SyncClient, error)

type MockClient added in v0.5.0

type MockClient struct {
	mock.Mock
}
var (
	Config       = ClientConfig{}
	MockedClient *MockClient
)

func NewMockClient added in v0.5.0

func NewMockClient() *MockClient

func (*MockClient) Close added in v0.5.0

func (m *MockClient) Close() error

func (*MockClient) Delete added in v0.5.0

func (m *MockClient) Delete(_ context.Context, key string, options ...oxia.DeleteOption) error

func (*MockClient) DeleteRange added in v0.5.0

func (m *MockClient) DeleteRange(_ context.Context, minKeyInclusive string, maxKeyExclusive string, options ...oxia.DeleteRangeOption) error

func (*MockClient) Get added in v0.5.0

func (m *MockClient) Get(_ context.Context, key string, options ...oxia.GetOption) (storedKey string, value []byte, version oxia.Version, err error)

func (*MockClient) GetNotifications added in v0.5.0

func (*MockClient) GetNotifications() (oxia.Notifications, error)

func (*MockClient) List added in v0.5.0

func (m *MockClient) List(_ context.Context, minKeyInclusive string, maxKeyExclusive string, options ...oxia.ListOption) (keys []string, err error)

func (*MockClient) Put added in v0.5.0

func (m *MockClient) Put(_ context.Context, key string, value []byte, options ...oxia.PutOption) (insertedKey string, version oxia.Version, err error)

func (*MockClient) RangeScan added in v0.5.0

func (m *MockClient) RangeScan(_ context.Context, minKeyInclusive string, maxKeyExclusive string, options ...oxia.RangeScanOption) <-chan oxia.GetResult

type OutputError

type OutputError struct {
	Err string `json:"error,omitempty"`
}

type OutputVersion

type OutputVersion struct {
	Key                string    `json:"key"`
	VersionId          int64     `json:"version_id"`
	CreatedTimestamp   time.Time `json:"created_timestamp"`
	ModifiedTimestamp  time.Time `json:"modified_timestamp"`
	ModificationsCount int64     `json:"modifications_count"`
	Ephemeral          bool      `json:"ephemeral"`
	ClientIdentity     string    `json:"client_identity"`
}

Jump to

Keyboard shortcuts

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