coord

package
v0.1.1-rc Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2018 License: Apache-2.0, CC-BY-4.0, MIT Imports: 12 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Endpoints []string
	Prefix    string
	Cert      string
	Username  string
	Password  string
}

Config ..config passed to the coordinator

type Coordinator

type Coordinator interface {
	Close(log *logger.LocLoggingEntry)
	Get(path string, log *logger.LocLoggingEntry, opts ...clientv3.OpOption) ([]EtcdKVGetResponse, error)
	Put(path string, value string, log *logger.LocLoggingEntry, opts ...clientv3.OpOption) (EtcdKVPutResponse, error)
	PutIfKeyExists(path string, value string, log *logger.LocLoggingEntry, opts ...clientv3.OpOption) (bool, error)
	PutIfKeyMissing(path string, value string, log *logger.LocLoggingEntry, opts ...clientv3.OpOption) (bool, error)
	CompareAndSwap(path string, newValue string, expectedOldValue string, log *logger.LocLoggingEntry, opts ...clientv3.OpOption) (bool, error)
	DeleteKeyIfExists(path string, log *logger.LocLoggingEntry, opts ...clientv3.OpOption) (bool, error)
	DeleteKeyWithOpts(path string, log *logger.LocLoggingEntry, opts ...clientv3.OpOption) error
	WatchPath(ctx context.Context, path string, log *logger.LocLoggingEntry, opts ...clientv3.OpOption) clientv3.WatchChan
	GrantExpiringLease(leaseTimeout int64, log *logger.LocLoggingEntry) (*clientv3.LeaseGrantResponse, error)
	RefreshLease(leaseID clientv3.LeaseID, log *logger.LocLoggingEntry) (*clientv3.LeaseKeepAliveResponse, error)
	RevokeLease(leaseID clientv3.LeaseID, log *logger.LocLoggingEntry) error
	GetLeaseDetails(leaseID clientv3.LeaseID, log *logger.LocLoggingEntry) (*clientv3.LeaseTimeToLiveResponse, error)
	NewQueue(queueName string, log *logger.LocLoggingEntry) *queueHandler
	NewValueSequence(sequenceName string, log *logger.LocLoggingEntry) *valueSequenceHandler
}

Coordinator ... interfacing declaring methods that can be consumed

func NewCoordinator

func NewCoordinator(config Config, log *logger.LocLoggingEntry) (Coordinator, error)

NewCoordinator ... create a new instance of coordinator. Passes the error back to client in case error is encountered

type EtcdKVGetResponse

type EtcdKVGetResponse struct {
	Key   string
	Value string
}

EtcdKVGetResponse ...

type EtcdKVPutResponse

type EtcdKVPutResponse struct {
	Key      string
	Value    string
	Revision int64
}

EtcdKVPutResponse ...

type QueueHandler

type QueueHandler interface {
	Enqueue(message string, log *logger.LocLoggingEntry) error
	Dequeue(log *logger.LocLoggingEntry) (string, error)
}

QueueHandler is a simple interface for a queue

type ValueSequence

type ValueSequence interface {
	AddNew(value string, log *logger.LocLoggingEntry) error
	GetAll(log *logger.LocLoggingEntry) ([]string, error)
}

ValueSequence is an interface for a sequence of values, stored in temporal order

Jump to

Keyboard shortcuts

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