atomix

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClient

func GetClient(config Config) (*client.Client, error)

GetClient returns the Atomix client

func GetDatabase

func GetDatabase(config Config, database string) (*client.Database, error)

GetDatabase returns the Atomix database

func StartLocalNode

func StartLocalNode() (*atomix.Node, netutil.Address)

StartLocalNode starts a single local Atomix node

Types

type Config

type Config struct {
	// Controller is the Atomix controller address
	Controller string `yaml:"controller,omitempty"`
	// Namespace is the Atomix namespace
	Namespace string `yaml:"namespace,omitempty"`
	// Scope is the Atomix client/application scope
	Scope string `yaml:"scope,omitempty"`
	// Databases is a mapping of database types to databases
	Databases map[DatabaseType]string `yaml:"databases"`
}

Config is the Atomix configuration

func (Config) GetController

func (c Config) GetController() string

GetController gets the Atomix controller address

func (Config) GetDatabase

func (c Config) GetDatabase(databaseType DatabaseType) string

GetDatabase gets the database name for the given database type

func (Config) GetNamespace

func (c Config) GetNamespace() string

GetNamespace gets the Atomix client namespace

func (Config) GetScope

func (c Config) GetScope() string

GetScope gets the Atomix client scope

type DatabaseType

type DatabaseType string

DatabaseType is the type of a database

const (
	// DatabaseTypeConsensus indicates a consensus database
	DatabaseTypeConsensus DatabaseType = "consensus"
	// DatabaseTypeCache indicates a cache database
	DatabaseTypeCache DatabaseType = "cache"
	// DatabaseTypeTimeSeries indicates a time series database
	DatabaseTypeTimeSeries DatabaseType = "timeSeries"
	// DatabaseTypeRelational indicates a relational database
	DatabaseTypeRelational DatabaseType = "relational"
)

Jump to

Keyboard shortcuts

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