client

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrDatabaseNotFound is returned when a database is not found
	ErrDatabaseNotFound = status.Error(codes.NotFound, "database is not initialised")
)

Functions

This section is empty.

Types

type Client

type Client interface {
	// Add adds a client connection for database db to the immudb server
	Add(db string) (immuclient.ImmuClient, error)

	// For returns the client for database db to the immudb server
	For(db string) (immuclient.ImmuClient, error)
}

Client is a multi database connection manager for immudb server

func New

func New(options *immuclient.Options) Client

New returns a new Client using the Options to connect to immudb. The returned client reads *and* writes directly to the server It understands how to work with with multiple databases.

func NewMockClient

func NewMockClient(cli immuclient.ImmuClient, opts *immuclient.Options) Client

NewMockClient returns a mock Client for defaultdb to the immudb server

func NewMockClientWithDb

func NewMockClientWithDb(cli immuclient.ImmuClient, opts *immuclient.Options, db string) Client

NewMockClientWithDb returns a mock Client for database db to the immudb server

Jump to

Keyboard shortcuts

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