state

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

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.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 ...

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