etcdstorage

package module
v0.0.0-...-27fb28f Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsMultipleValuesFound

func IsMultipleValuesFound(err error) bool

IsMultipleValuesFound asserts multipleValuesError.

Types

type Config

type Config struct {
	// Dependencies.
	EtcdClient *clientv3.Client

	// Settings.
	Prefix  string
	Timeout time.Duration
}

Config represents the configuration used to create a etcd service.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig provides a default configuration to create a new etcd service by best effort.

type Service

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

Service is the etcd service.

func New

func New(config Config) (*Service, error)

New creates a new configured etcd service.

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, k microstorage.K) error

func (*Service) Exists

func (s *Service) Exists(ctx context.Context, k microstorage.K) (bool, error)

func (*Service) List

func (s *Service) List(ctx context.Context, k microstorage.K) ([]microstorage.KV, error)

func (*Service) Put

func (s *Service) Put(ctx context.Context, kv microstorage.KV) error

func (*Service) Search

func (s *Service) Search(ctx context.Context, k microstorage.K) (microstorage.KV, error)

Jump to

Keyboard shortcuts

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