Documentation ¶
Overview ¶
Public Dependency type information.
This sub-package contains all the required types needed to implement an external dependency as used by this library.
It is a sub-package as all the current dependency implentations are contained in an internal/ package as it needs some significant refactoring that shouldn't interfere with the initial release.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrContinue = errors.New("dependency continue")
ErrContinue is a special error which says to continue (retry) on error.
var ErrLeaseExpired = errors.New("lease expired or is not renewable")
var ErrStopped = errors.New("dependency stopped")
ErrStopped is a special error that is returned when a dependency is prematurely stopped, usually due to a configuration reload or a process interrupt.
Functions ¶
This section is empty.
Types ¶
type CatalogNode ¶
type CatalogNode struct { Node *Node Services []*CatalogNodeService }
CatalogNode is a wrapper around the node and its services.
type CatalogNodeService ¶
type CatalogNodeService struct { ID string Service string Tags ServiceTags Meta map[string]string Port int Address string EnableTagOverride bool }
CatalogNodeService is a service on a single node.
type CatalogSnippet ¶
type CatalogSnippet struct { Name string Tags ServiceTags }
CatalogSnippet is a catalog entry in Consul.
type Dependency ¶
type Dependency interface { Fetch(Clients) (interface{}, *ResponseMetadata, error) ID() string Stop() fmt.Stringer }
Dependency is an interface for an external dependency to be monitored.
type HealthService ¶
type HealthService struct { Node string NodeID string NodeAddress string NodeDatacenter string NodeTaggedAddresses map[string]string NodeMeta map[string]string ServiceMeta map[string]string Address string ServiceTaggedAddresses map[string]api.ServiceAddress ID string Name string Kind string Tags ServiceTags Checks api.HealthChecks Status string Port int Weights api.AgentWeights Namespace string }
HealthService is a service entry in Consul.
type KeyPair ¶
type KeyPair struct { Path string Key string Value string Exists bool // Lesser-used, but still valuable keys from api.KV CreateIndex uint64 ModifyIndex uint64 LockIndex uint64 Flags uint64 Session string }
KeyPair is a simple Key-Value pair
type Node ¶
type Node struct { ID string Node string Address string Datacenter string TaggedAddresses map[string]string Meta map[string]string }
Node is a node entry in Consul
type ResponseMetadata ¶
Metadata returned by external dependency Fetch-ing. LastIndex is used with the Consul backend. Needed to track changes. LastContact is used to help calculate staleness of records.
type Secret ¶
type Secret struct { // The request ID that generated this response RequestID string LeaseID string LeaseDuration int Renewable bool // Data is the actual contents of the secret. The format of the data // is arbitrary and up to the secret backend. Data map[string]interface{} // Warnings contains any warnings related to the operation. These // are not issues that caused the command to fail, but that the // client should be aware of. Warnings []string // Auth, if non-nil, means that there was authentication information // attached to this response. Auth *SecretAuth // WrapInfo, if non-nil, means that the initial response was wrapped in the // cubbyhole of the given token (which has a TTL of the given number of // seconds) WrapInfo *SecretWrapInfo }
Secret is the structure returned for every secret within Vault.
type SecretAuth ¶
type SecretAuth struct { ClientToken string Accessor string Policies []string Metadata map[string]string LeaseDuration int Renewable bool }
SecretAuth is the structure containing auth information if we have it.
type SecretWrapInfo ¶
SecretWrapInfo contains wrapping information if we have it. If what is contained is an authentication token, the accessor for the token will be available in WrappedAccessor.