state

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const SERVER_UUID_HEADER = "immudb-uuid"

SERVER_UUID_HEADER ...

Variables

View Source
var ErrNoServerUuid = fmt.Errorf(
	"!IMPORTANT WARNING: %s header is not published by the immudb server; "+
		"this client MUST NOT be used to connect to different immudb servers!",
	SERVER_UUID_HEADER)

ErrNoServerUuid ...

Functions

This section is empty.

Types

type StateProvider

type StateProvider interface {
	CurrentState(ctx context.Context) (*schema.ImmutableState, error)
}

func NewStateProvider

func NewStateProvider(client schema.ImmuServiceClient) StateProvider

type StateService

type StateService interface {
	GetState(ctx context.Context, db string) (*schema.ImmutableState, error)
	SetState(db string, state *schema.ImmutableState) error
	CacheLock() error
	CacheUnlock() error
}

StateService the root service interface

func NewStateService

func NewStateService(cache cache.Cache,
	logger logger.Logger,
	stateProvider StateProvider,
	uuidProvider UUIDProvider) (StateService, error)

NewStateService ...

func NewStateServiceWithUUID added in v1.2.0

func NewStateServiceWithUUID(cache cache.Cache,
	logger logger.Logger,
	stateProvider StateProvider,
	serverUUID string) (StateService, error)

NewStateService ...

type UUIDProvider

type UUIDProvider interface {
	CurrentUUID(ctx context.Context) (string, error)
}

func NewUUIDProvider

func NewUUIDProvider(client schema.ImmuServiceClient) UUIDProvider

Jump to

Keyboard shortcuts

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