client

package
Version: v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2020 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is an Atomix client

func New

func New(address string, opts ...Option) (*Client, error)

New creates a new Atomix client

func NewWithContext added in v0.3.1

func NewWithContext(ctx context.Context, address string, opts ...Option) (*Client, error)

NewWithContext returns a new Atomix client

func (*Client) Close

func (c *Client) Close() error

Close closes the client

func (*Client) GetDatabase

func (c *Client) GetDatabase(ctx context.Context, name string) (*Database, error)

GetDatabase gets a database client by name from the client's namespace

func (*Client) GetDatabases

func (c *Client) GetDatabases(ctx context.Context) ([]*Database, error)

GetDatabases returns a list of all databases in the client's namespace

func (*Client) Group added in v0.2.0

func (c *Client) Group() *peer.Group

Group returns the peer group

type Database

type Database struct {
	Namespace string
	Name      string
	// contains filtered or unexported fields
}

Database manages the primitives in a set of partitions

func (*Database) GetCounter

func (d *Database) GetCounter(ctx context.Context, name string) (counter.Counter, error)

GetCounter gets or creates a Counter with the given name

func (*Database) GetElection

func (d *Database) GetElection(ctx context.Context, name string, opts ...election.Option) (election.Election, error)

GetElection gets or creates an Election with the given name

func (*Database) GetIndexedMap

func (d *Database) GetIndexedMap(ctx context.Context, name string) (indexedmap.IndexedMap, error)

GetIndexedMap gets or creates a Map with the given name

func (*Database) GetLeaderLatch

func (d *Database) GetLeaderLatch(ctx context.Context, name string, opts ...leader.Option) (leader.Latch, error)

GetLeaderLatch gets or creates a LeaderLatch with the given name

func (*Database) GetList

func (d *Database) GetList(ctx context.Context, name string) (list.List, error)

GetList gets or creates a List with the given name

func (*Database) GetLock

func (d *Database) GetLock(ctx context.Context, name string) (lock.Lock, error)

GetLock gets or creates a Lock with the given name

func (*Database) GetLog

func (d *Database) GetLog(ctx context.Context, name string) (log.Log, error)

GetLog gets or creates a Log with the given name

func (*Database) GetMap

func (d *Database) GetMap(ctx context.Context, name string, opts ..._map.Option) (_map.Map, error)

GetMap gets or creates a Map with the given name

func (*Database) GetPrimitives

func (d *Database) GetPrimitives(ctx context.Context, opts ...primitive.MetadataOption) ([]primitive.Metadata, error)

GetPrimitives gets a list of primitives in the database

func (*Database) GetSet

func (d *Database) GetSet(ctx context.Context, name string) (set.Set, error)

GetSet gets or creates a Set with the given name

func (*Database) GetValue

func (d *Database) GetValue(ctx context.Context, name string) (value.Value, error)

GetValue gets or creates a Value with the given name

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option provides a client option

func WithApplication

func WithApplication(application string) Option

WithApplication configures the application name for the client Deprecated: Use WithScope instead

func WithJoinTimeout added in v0.2.0

func WithJoinTimeout(timeout time.Duration) Option

WithJoinTimeout configures the client's join timeout

func WithMemberID added in v0.2.0

func WithMemberID(memberID string) Option

WithMemberID configures the client's member ID

func WithNamespace

func WithNamespace(namespace string) Option

WithNamespace configures the client's partition group namespace

func WithPeerHost added in v0.2.0

func WithPeerHost(host string) Option

WithPeerHost configures the client's peer host

func WithPeerPort added in v0.2.0

func WithPeerPort(port int) Option

WithPeerPort configures the client's peer port

func WithPeerServerOption added in v0.2.1

func WithPeerServerOption(option grpc.ServerOption) Option

WithPeerServerOption configures a server option

func WithPeerService added in v0.2.1

func WithPeerService(service peer.Service) Option

WithPeerService configures a peer-to-peer service

func WithScope

func WithScope(scope string) Option

WithScope configures the application scope for the client

func WithSessionTimeout

func WithSessionTimeout(timeout time.Duration) Option

WithSessionTimeout sets the session timeout for the client

Jump to

Keyboard shortcuts

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