rootservice

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

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 ImmudbRootProvider

type ImmudbRootProvider struct {
	// contains filtered or unexported fields
}

func NewImmudbRootProvider

func NewImmudbRootProvider(client schema.ImmuServiceClient) *ImmudbRootProvider

func (ImmudbRootProvider) CurrentRoot

func (r ImmudbRootProvider) CurrentRoot(ctx context.Context) (*schema.Root, error)

type ImmudbUUIDProvider

type ImmudbUUIDProvider struct {
	// contains filtered or unexported fields
}

func NewImmudbUUIDProvider

func NewImmudbUUIDProvider(client schema.ImmuServiceClient) *ImmudbUUIDProvider

func (ImmudbUUIDProvider) CurrentUUID

func (r ImmudbUUIDProvider) CurrentUUID(ctx context.Context) (string, error)

CurrentUUID issues a Health command to the server, then parses and returns the server UUID from the response metadata

type RootProvider

type RootProvider interface {
	CurrentRoot(ctx context.Context) (*schema.Root, error)
}

type RootService

type RootService interface {
	GetRoot(ctx context.Context, databasename string) (*schema.Root, error)
	SetRoot(root *schema.Root, databasename string) error
}

RootService the root service interface

func NewRootService

func NewRootService(cache cache.Cache,
	logger logger.Logger,
	rootProvider RootProvider,
	uuidProvider UUIDProvider) (RootService, error)

NewRootService ...

type UUIDProvider

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

Jump to

Keyboard shortcuts

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