Back to

Package etcd

Latest Go to latest

The latest major version is .

Published: Nov 21, 2019 | License: Apache-2.0 | Module:


func NewStore

func NewStore(c *clientv3.Client, opts Options) (services.HeartbeatService, error)

NewStore creates a heartbeat store based on etcd

type Options

type Options interface {
	// RequestTimeout is the timeout for etcd requests
	RequestTimeout() time.Duration
	// SetRequestTimeout sets the RequestTimeout
	SetRequestTimeout(t time.Duration) Options

	// InstrumentsOptions is the instrument options
	InstrumentsOptions() instrument.Options
	// SetInstrumentsOptions sets the InstrumentsOptions
	SetInstrumentsOptions(iopts instrument.Options) Options

	// RetryOptions is the retry options
	RetryOptions() retry.Options
	// SetRetryOptions sets the RetryOptions
	SetRetryOptions(ropts retry.Options) Options

	// WatchChanCheckInterval will be used to periodically check if a watch chan
	// is no longer being subscribed and should be closed
	WatchChanCheckInterval() time.Duration
	// SetWatchChanCheckInterval sets the WatchChanCheckInterval
	SetWatchChanCheckInterval(t time.Duration) Options

	// WatchChanResetInterval is the delay before resetting the etcd watch chan
	WatchChanResetInterval() time.Duration
	// SetWatchChanResetInterval sets the WatchChanResetInterval
	SetWatchChanResetInterval(t time.Duration) Options

	// WatchChanInitTimeout is the timeout for a watchChan initialization
	WatchChanInitTimeout() time.Duration
	// SetWatchChanInitTimeout sets the WatchChanInitTimeout
	SetWatchChanInitTimeout(t time.Duration) Options

	// ServiceID returns the service the heartbeat store is managing heartbeats for.
	ServiceID() services.ServiceID

	// SetServiceID sets the service the heartbeat store is managing heartbeats for.
	SetServiceID(sid services.ServiceID) Options

	// Validate validates the Options
	Validate() error

Options are options for the client of the kv store

func NewOptions

func NewOptions() Options

NewOptions creates a sane default Option

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier