etcd

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsCreateFailed

func IsCreateFailed(err error) bool

IsCreateFailed asserts createFailedError.

func IsEtcdKeyAlreadyExists

func IsEtcdKeyAlreadyExists(err error) bool

IsEtcdKeyAlreadyExists is an error matcher for the v2 etcd client.

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsMultipleValuesFound

func IsMultipleValuesFound(err error) bool

IsMultipleValuesFound asserts multipleValuesError.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound asserts notFoundError.

Types

type Config

type Config struct {
	// Dependencies.
	EtcdClient client.Client

	// Settings.
	Prefix string
}

Config represents the configuration used to create a service.

func DefaultConfig

func DefaultConfig() Config

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

type Service

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

Service provides the actual service implementation.

func New

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

New creates a new configured service.

func (*Service) Create

func (s *Service) Create(ctx context.Context, key, value string) error

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, key string) error

func (*Service) Exists

func (s *Service) Exists(ctx context.Context, key string) (bool, error)

func (*Service) List

func (s *Service) List(ctx context.Context, key string) ([]string, error)

func (*Service) Search

func (s *Service) Search(ctx context.Context, key string) (string, error)

type Store

type Store interface {
	Create(ctx context.Context, key, value string) error
	Delete(ctx context.Context, key string) error
	Exists(ctx context.Context, key string) (bool, error)
	List(ctx context.Context, key string) ([]string, error)
	Search(ctx context.Context, key string) (string, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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