Documentation
¶
Index ¶
- Variables
- type EventType
- type Registration
- type Registry
- func (rr *Registry) Delete(ctx context.Context, graphType, graphName string) error
- func (rr *Registry) Insert(ctx context.Context, graphType, graphName string, state State, config []byte) error
- func (rr *Registry) Select(ctx context.Context, graphType, graphName string) (*Registration, error)
- func (rr *Registry) SetWanted(ctx context.Context, graphType, graphName string, state State) error
- func (rr *Registry) Watch(ctx context.Context) ([]*WatchEvent, <-chan *WatchEvent, error)
- type State
- type WatchEvent
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNilEtcd when etcd client is nil. ErrNilEtcd = errors.New("nil etcd") // ErrFailedInsert when etcd returns no error for a key // insert but the success flag is false. ErrFailedInsert = errors.New("failed insert") // ErrFailedDelete when etcd returns no error for a key // delete but the success flag is false. ErrFailedDelete = errors.New("failed delete") // ErrAlreadyDeleted when the given entry already exists. ErrAlreadyDeleted = errors.New("already deleted") // ErrAlreadyInserted when the given entry already exists. ErrAlreadyInserted = errors.New("already inserted") // ErrZeroValues when no value is found. ErrZeroValues = errors.New("zero values") // ErrMultipleValues when multiple values are found under one // key, meaning that the key is not a key but a prefix. ErrMultipleValues = errors.New("multiple values") // ErrWatchClosedUnexpectedly when a watch closes and no error // is reported by the etcd client. ErrWatchClosedUnexpectedly = errors.New("watch closed unexpectedly") )
Functions ¶
This section is empty.
Types ¶
type Registration ¶
type Registration struct { Type string `json:"type"` Name string `json:"name"` Wanted string `json:"wanted"` Config string `json:"config"` }
Registration information.
func (*Registration) String ¶
func (r *Registration) String() string
String descritpion of registration.
func (*Registration) UnmarshalConfig ¶
func (r *Registration) UnmarshalConfig() ([]byte, error)
UnmarshalConfig which has a base type of []byte but is marshalled as a base64 string.
type Registry ¶
Registry for discovery.
func (*Registry) Insert ¶
func (rr *Registry) Insert(ctx context.Context, graphType, graphName string, state State, config []byte) error
Insert the graph entry.
func (*Registry) Watch ¶
func (rr *Registry) Watch(ctx context.Context) ([]*WatchEvent, <-chan *WatchEvent, error)
Watch a prefix in the registry.
type WatchEvent ¶
type WatchEvent struct { Key string Reg *Registration Type EventType Error error }
WatchEvent triggred by a change in the registry.
func (*WatchEvent) String ¶
func (we *WatchEvent) String() string
String representation of the watch event.
Click to show internal directories.
Click to hide internal directories.