atomix

package
v0.6.15 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: Apache-2.0 Imports: 14 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 RegisterService added in v0.6.5

func RegisterService(service cluster.Service)

RegisterService registers a service with the Atomix cluster

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"`
	// Member is the Atomix member name
	Member string `yaml:"member,omitempty"`
	// Host is the Atomix member hostname
	Host string `yaml:"host,omitempty"`
	// Port is the Atomix member port
	Port int `yaml:"port,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) GetHost added in v0.6.4

func (c Config) GetHost() string

GetHost gets the Atomix peer host

func (Config) GetMember added in v0.6.4

func (c Config) GetMember() string

GetMember gets the Atomix member name

func (Config) GetNamespace

func (c Config) GetNamespace() string

GetNamespace gets the Atomix client namespace

func (Config) GetPort added in v0.6.4

func (c Config) GetPort() int

GetPort gets the Atomix peer port

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 (
	// DatabaseTypeConfig indicates a configuration database
	DatabaseTypeConfig DatabaseType = "config"
	// DatabaseTypeCache indicates a cache database
	DatabaseTypeCache DatabaseType = "cache"
	// DatabaseTypeEvent indicates an event database
	DatabaseTypeEvent DatabaseType = "event"

	// DatabaseTypeConsensus indicates a consensus database
	// Deprecated: Use DatabaseTypeConfig instead
	DatabaseTypeConsensus DatabaseType = "consensus"
	// DatabaseTypeTimeSeries indicates a time series database
	// Deprecated: Use DatabaseTypeEvent instead
	DatabaseTypeTimeSeries DatabaseType = "timeSeries"
	// DatabaseTypeRelational indicates a relational database
	// Deprecated: Use DatabaseTypeConfig or DatabaseTypeCache instead
	DatabaseTypeRelational DatabaseType = "relational"
)

type ServiceRegistry added in v0.6.5

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

ServiceRegistry is a registry of Atomix services

func (*ServiceRegistry) Register added in v0.6.5

func (r *ServiceRegistry) Register(service cluster.Service)

Register registers a service

Jump to

Keyboard shortcuts

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