common

package
v0.0.0-...-c116e45 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// DefaultRetryCount for etcd operations
	DefaultRetryCount = 60
	// DefaultIntervalBetweenRetries for etcd failed operations
	DefaultIntervalBetweenRetries = time.Millisecond * 500
	// Bootstrap key
	Bootstrap = "kvdb/bootstrap"
	// DefaultDialTimeout in etcd http requests
	// the maximum amount of time a dial will wait for a connection to setup.
	// 30s is long enough for most of the network conditions.
	DefaultDialTimeout = 30 * time.Second
	// DefaultLockTTL is the ttl for an etcd lock
	DefaultLockTTL = 16
	// DefaultLockRefreshDuration is the time interval for refreshing an etcd lock
	DefaultLockRefreshDuration = 2 * time.Second
)

Variables

This section is empty.

Functions

func Version

func Version(url string, options map[string]string) (string, error)

Version returns the version of the provided etcd server

Types

type EtcdCommon

type EtcdCommon interface {
	// GetAuthInfoFromOptions
	GetAuthInfoFromOptions() (transport.TLSInfo, string, string, error)

	// GetRetryCount
	GetRetryCount() int
}

EtcdCommon defined the common functions between v2 and v3 etcd implementations.

func NewEtcdCommon

func NewEtcdCommon(options map[string]string) EtcdCommon

NewEtcdCommon returns the EtcdCommon interface

type EtcdLock

type EtcdLock struct {
	Done     chan struct{}
	Unlocked bool
	Err      error
	Tag      string
	sync.Mutex
}

EtcdLock combines Mutex and channel

type LockerIDInfo

type LockerIDInfo struct {
	LockerID string
}

LockerIDInfo id of locker

Jump to

Keyboard shortcuts

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