consul-template: github.com/hashicorp/consul-template/dependency Index | Files

package dependency

import "github.com/hashicorp/consul-template/dependency"

Index

Package Files

catalog_datacenters.go catalog_node.go catalog_nodes.go catalog_service.go catalog_services.go client_set.go connect_ca.go connect_leaf.go dependency.go errors.go file.go health_service.go kv_get.go kv_keys.go kv_list.go set.go vault_agent_token.go vault_common.go vault_list.go vault_read.go vault_token.go vault_write.go

Constants

const (
    HealthAny      = "any"
    HealthPassing  = "passing"
    HealthWarning  = "warning"
    HealthCritical = "critical"
    HealthMaint    = "maintenance"

    NodeMaint    = "_node_maintenance"
    ServiceMaint = "_service_maintenance:"
)
const (
    // VaultAgentTokenSleepTime is the amount of time to sleep between queries, since
    // the fsnotify library is not compatible with solaris and other OSes yet.
    VaultAgentTokenSleepTime = 15 * time.Second
)

Variables

var (

    // CatalogDatacentersQuerySleepTime is the amount of time to sleep between
    // queries, since the endpoint does not support blocking queries.
    CatalogDatacentersQuerySleepTime = 15 * time.Second
)
var (

    // CatalogNodeQueryRe is the regular expression to use.
    CatalogNodeQueryRe = regexp.MustCompile(`\A` + nodeNameRe + dcRe + `\z`)
)
var (

    // CatalogNodesQueryRe is the regular expression to use.
    CatalogNodesQueryRe = regexp.MustCompile(`\A` + dcRe + nearRe + `\z`)
)
var (

    // CatalogServiceQueryRe is the regular expression to use.
    CatalogServiceQueryRe = regexp.MustCompile(`\A` + tagRe + serviceNameRe + dcRe + nearRe + `\z`)
)
var (

    // CatalogServicesQueryRe is the regular expression to use for CatalogNodesQuery.
    CatalogServicesQueryRe = regexp.MustCompile(`\A` + dcRe + `\z`)
)
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.

var (

    // FileQuerySleepTime is the amount of time to sleep between queries, since
    // the fsnotify library is not compatible with solaris and other OSes yet.
    FileQuerySleepTime = 2 * time.Second
)
var (

    // HealthServiceQueryRe is the regular expression to use.
    HealthServiceQueryRe = regexp.MustCompile(`\A` + tagRe + serviceNameRe + dcRe + nearRe + filterRe + `\z`)
)
var (

    // KVGetQueryRe is the regular expression to use.
    KVGetQueryRe = regexp.MustCompile(`\A` + keyRe + dcRe + `\z`)
)
var (

    // KVKeysQueryRe is the regular expression to use.
    KVKeysQueryRe = regexp.MustCompile(`\A` + prefixRe + dcRe + `\z`)
)
var (

    // KVListQueryRe is the regular expression to use.
    KVListQueryRe = regexp.MustCompile(`\A` + prefixRe + dcRe + `\z`)
)
var (
    // VaultDefaultLeaseDuration is the default lease duration in seconds.
    VaultDefaultLeaseDuration = 5 * time.Minute
)

type ByName Uses

type ByName []*CatalogSnippet

ByName is a sortable slice of CatalogService structs.

func (ByName) Len Uses

func (s ByName) Len() int

func (ByName) Less Uses

func (s ByName) Less(i, j int) bool

func (ByName) Swap Uses

func (s ByName) Swap(i, j int)

type ByNode Uses

type ByNode []*Node

ByNode is a sortable list of nodes by name and then IP address.

func (ByNode) Len Uses

func (s ByNode) Len() int

func (ByNode) Less Uses

func (s ByNode) Less(i, j int) bool

func (ByNode) Swap Uses

func (s ByNode) Swap(i, j int)

type ByNodeThenID Uses

type ByNodeThenID []*HealthService

ByNodeThenID is a sortable slice of Service

func (ByNodeThenID) Len Uses

func (s ByNodeThenID) Len() int

Len, Swap, and Less are used to implement the sort.Sort interface.

func (ByNodeThenID) Less Uses

func (s ByNodeThenID) Less(i, j int) bool

func (ByNodeThenID) Swap Uses

func (s ByNodeThenID) Swap(i, j int)

type ByService Uses

type ByService []*CatalogNodeService

ByService is a sorter of node services by their service name and then ID.

func (ByService) Len Uses

func (s ByService) Len() int

func (ByService) Less Uses

func (s ByService) Less(i, j int) bool

func (ByService) Swap Uses

func (s ByService) Swap(i, j int)

type CatalogDatacentersQuery Uses

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

CatalogDatacentersQuery is the dependency to query all datacenters

func NewCatalogDatacentersQuery Uses

func NewCatalogDatacentersQuery(ignoreFailing bool) (*CatalogDatacentersQuery, error)

NewCatalogDatacentersQuery creates a new datacenter dependency.

func (*CatalogDatacentersQuery) CanShare Uses

func (d *CatalogDatacentersQuery) CanShare() bool

CanShare returns if this dependency is shareable.

func (*CatalogDatacentersQuery) Fetch Uses

func (d *CatalogDatacentersQuery) Fetch(clients *ClientSet, opts *QueryOptions) (interface{}, *ResponseMetadata, error)

Fetch queries the Consul API defined by the given client and returns a slice of strings representing the datacenters

func (*CatalogDatacentersQuery) Stop Uses

func (d *CatalogDatacentersQuery) Stop()

Stop terminates this dependency's fetch.

func (*CatalogDatacentersQuery) String Uses

func (d *CatalogDatacentersQuery) String() string

String returns the human-friendly version of this dependency.

func (*CatalogDatacentersQuery) Type Uses

func (d *CatalogDatacentersQuery) Type() Type

Type returns the type of this dependency.

type CatalogNode Uses

type CatalogNode struct {
    Node     *Node
    Services []*CatalogNodeService
}

CatalogNode is a wrapper around the node and its services.

type CatalogNodeQuery Uses

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

CatalogNodeQuery represents a single node from the Consul catalog.

func NewCatalogNodeQuery Uses

func NewCatalogNodeQuery(s string) (*CatalogNodeQuery, error)

NewCatalogNodeQuery parses the given string into a dependency. If the name is empty then the name of the local agent is used.

func (*CatalogNodeQuery) CanShare Uses

func (d *CatalogNodeQuery) CanShare() bool

CanShare returns a boolean if this dependency is shareable.

func (*CatalogNodeQuery) Fetch Uses

func (d *CatalogNodeQuery) Fetch(clients *ClientSet, opts *QueryOptions) (interface{}, *ResponseMetadata, error)

Fetch queries the Consul API defined by the given client and returns a of CatalogNode object.

func (*CatalogNodeQuery) Stop Uses

func (d *CatalogNodeQuery) Stop()

Stop halts the dependency's fetch function.

func (*CatalogNodeQuery) String Uses

func (d *CatalogNodeQuery) String() string

String returns the human-friendly version of this dependency.

func (*CatalogNodeQuery) Type Uses

func (d *CatalogNodeQuery) Type() Type

Type returns the type of this dependency.

type CatalogNodeService Uses

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 CatalogNodesQuery Uses

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

CatalogNodesQuery is the representation of all registered nodes in Consul.

func NewCatalogNodesQuery Uses

func NewCatalogNodesQuery(s string) (*CatalogNodesQuery, error)

NewCatalogNodesQuery parses the given string into a dependency. If the name is empty then the name of the local agent is used.

func (*CatalogNodesQuery) CanShare Uses

func (d *CatalogNodesQuery) CanShare() bool

CanShare returns a boolean if this dependency is shareable.

func (*CatalogNodesQuery) Fetch Uses

func (d *CatalogNodesQuery) Fetch(clients *ClientSet, opts *QueryOptions) (interface{}, *ResponseMetadata, error)

Fetch queries the Consul API defined by the given client and returns a slice of Node objects

func (*CatalogNodesQuery) Stop Uses

func (d *CatalogNodesQuery) Stop()

Stop halts the dependency's fetch function.

func (*CatalogNodesQuery) String Uses

func (d *CatalogNodesQuery) String() string

String returns the human-friendly version of this dependency.

func (*CatalogNodesQuery) Type Uses

func (d *CatalogNodesQuery) Type() Type

Type returns the type of this dependency.

type CatalogService Uses

type CatalogService struct {
    ID              string
    Node            string
    Address         string
    Datacenter      string
    TaggedAddresses map[string]string
    NodeMeta        map[string]string
    ServiceID       string
    ServiceName     string
    ServiceAddress  string
    ServiceTags     ServiceTags
    ServiceMeta     map[string]string
    ServicePort     int
}

CatalogService is a catalog entry in Consul.

type CatalogServiceQuery Uses

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

CatalogServiceQuery is the representation of a requested catalog services dependency from inside a template.

func NewCatalogServiceQuery Uses

func NewCatalogServiceQuery(s string) (*CatalogServiceQuery, error)

NewCatalogServiceQuery parses a string into a CatalogServiceQuery.

func (*CatalogServiceQuery) CanShare Uses

func (d *CatalogServiceQuery) CanShare() bool

CanShare returns a boolean if this dependency is shareable.

func (*CatalogServiceQuery) Fetch Uses

func (d *CatalogServiceQuery) Fetch(clients *ClientSet, opts *QueryOptions) (interface{}, *ResponseMetadata, error)

Fetch queries the Consul API defined by the given client and returns a slice of CatalogService objects.

func (*CatalogServiceQuery) Stop Uses

func (d *CatalogServiceQuery) Stop()

Stop halts the dependency's fetch function.

func (*CatalogServiceQuery) String Uses

func (d *CatalogServiceQuery) String() string

String returns the human-friendly version of this dependency.

func (*CatalogServiceQuery) Type Uses

func (d *CatalogServiceQuery) Type() Type

Type returns the type of this dependency.

type CatalogServicesQuery Uses

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

CatalogServicesQuery is the representation of a requested catalog service dependency from inside a template.

func NewCatalogServicesQuery Uses

func NewCatalogServicesQuery(s string) (*CatalogServicesQuery, error)

NewCatalogServicesQuery parses a string of the format @dc.

func (*CatalogServicesQuery) CanShare Uses

func (d *CatalogServicesQuery) CanShare() bool

CanShare returns a boolean if this dependency is shareable.

func (*CatalogServicesQuery) Fetch Uses

func (d *CatalogServicesQuery) Fetch(clients *ClientSet, opts *QueryOptions) (interface{}, *ResponseMetadata, error)

Fetch queries the Consul API defined by the given client and returns a slice of CatalogService objects.

func (*CatalogServicesQuery) Stop Uses

func (d *CatalogServicesQuery) Stop()

Stop halts the dependency's fetch function.

func (*CatalogServicesQuery) String Uses

func (d *CatalogServicesQuery) String() string

String returns the human-friendly version of this dependency.

func (*CatalogServicesQuery) Type Uses

func (d *CatalogServicesQuery) Type() Type

Type returns the type of this dependency.

type CatalogSnippet Uses

type CatalogSnippet struct {
    Name string
    Tags ServiceTags
}

CatalogSnippet is a catalog entry in Consul.

type ClientSet Uses

type ClientSet struct {
    sync.RWMutex
    // contains filtered or unexported fields
}

ClientSet is a collection of clients that dependencies use to communicate with remote services like Consul or Vault.

func NewClientSet Uses

func NewClientSet() *ClientSet

NewClientSet creates a new client set that is ready to accept clients.

func (*ClientSet) Consul Uses

func (c *ClientSet) Consul() *consulapi.Client

Consul returns the Consul client for this set.

func (*ClientSet) CreateConsulClient Uses

func (c *ClientSet) CreateConsulClient(i *CreateConsulClientInput) error

CreateConsulClient creates a new Consul API client from the given input.

func (*ClientSet) CreateVaultClient Uses

func (c *ClientSet) CreateVaultClient(i *CreateVaultClientInput) error

func (*ClientSet) Stop Uses

func (c *ClientSet) Stop()

Stop closes all idle connections for any attached clients.

func (*ClientSet) Vault Uses

func (c *ClientSet) Vault() *vaultapi.Client

Vault returns the Vault client for this set.

type ConnectCAQuery Uses

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

func NewConnectCAQuery Uses

func NewConnectCAQuery() *ConnectCAQuery

func (*ConnectCAQuery) CanShare Uses

func (d *ConnectCAQuery) CanShare() bool

func (*ConnectCAQuery) Fetch Uses

func (d *ConnectCAQuery) Fetch(clients *ClientSet, opts *QueryOptions) (
    interface{}, *ResponseMetadata, error,
)

func (*ConnectCAQuery) Stop Uses

func (d *ConnectCAQuery) Stop()

func (*ConnectCAQuery) String Uses

func (d *ConnectCAQuery) String() string

func (*ConnectCAQuery) Type Uses

func (d *ConnectCAQuery) Type() Type

type ConnectLeafQuery Uses

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

func NewConnectLeafQuery Uses

func NewConnectLeafQuery(service string) *ConnectLeafQuery

func (*ConnectLeafQuery) CanShare Uses

func (d *ConnectLeafQuery) CanShare() bool

func (*ConnectLeafQuery) Fetch Uses

func (d *ConnectLeafQuery) Fetch(clients *ClientSet, opts *QueryOptions) (
    interface{}, *ResponseMetadata, error,
)

func (*ConnectLeafQuery) Stop Uses

func (d *ConnectLeafQuery) Stop()

func (*ConnectLeafQuery) String Uses

func (d *ConnectLeafQuery) String() string

func (*ConnectLeafQuery) Type Uses

func (d *ConnectLeafQuery) Type() Type

type CreateConsulClientInput Uses

type CreateConsulClientInput struct {
    Address      string
    Namespace    string
    Token        string
    AuthEnabled  bool
    AuthUsername string
    AuthPassword string
    SSLEnabled   bool
    SSLVerify    bool
    SSLCert      string
    SSLKey       string
    SSLCACert    string
    SSLCAPath    string
    ServerName   string

    TransportDialKeepAlive       time.Duration
    TransportDialTimeout         time.Duration
    TransportDisableKeepAlives   bool
    TransportIdleConnTimeout     time.Duration
    TransportMaxIdleConns        int
    TransportMaxIdleConnsPerHost int
    TransportTLSHandshakeTimeout time.Duration
}

CreateConsulClientInput is used as input to the CreateConsulClient function.

type CreateVaultClientInput Uses

type CreateVaultClientInput struct {
    Address     string
    Namespace   string
    Token       string
    UnwrapToken bool
    SSLEnabled  bool
    SSLVerify   bool
    SSLCert     string
    SSLKey      string
    SSLCACert   string
    SSLCAPath   string
    ServerName  string

    TransportDialKeepAlive       time.Duration
    TransportDialTimeout         time.Duration
    TransportDisableKeepAlives   bool
    TransportIdleConnTimeout     time.Duration
    TransportMaxIdleConns        int
    TransportMaxIdleConnsPerHost int
    TransportTLSHandshakeTimeout time.Duration
}

CreateVaultClientInput is used as input to the CreateVaultClient function.

type Dependency Uses

type Dependency interface {
    Fetch(*ClientSet, *QueryOptions) (interface{}, *ResponseMetadata, error)
    CanShare() bool
    String() string
    Stop()
    Type() Type
}

Dependency is an interface for a dependency that Consul Template is capable of watching.

type FileQuery Uses

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

FileQuery represents a local file dependency.

func NewFileQuery Uses

func NewFileQuery(s string) (*FileQuery, error)

NewFileQuery creates a file dependency from the given path.

func (*FileQuery) CanShare Uses

func (d *FileQuery) CanShare() bool

CanShare returns a boolean if this dependency is shareable.

func (*FileQuery) Fetch Uses

func (d *FileQuery) Fetch(clients *ClientSet, opts *QueryOptions) (interface{}, *ResponseMetadata, error)

Fetch retrieves this dependency and returns the result or any errors that occur in the process.

func (*FileQuery) Stop Uses

func (d *FileQuery) Stop()

Stop halts the dependency's fetch function.

func (*FileQuery) String Uses

func (d *FileQuery) String() string

String returns the human-friendly version of this dependency.

func (*FileQuery) Type Uses

func (d *FileQuery) Type() Type

Type returns the type of this dependency.

type HealthService Uses

type HealthService struct {
    Node                string
    NodeID              string
    NodeAddress         string
    NodeTaggedAddresses map[string]string
    NodeMeta            map[string]string
    ServiceMeta         map[string]string
    Address             string
    ID                  string
    Name                string
    Tags                ServiceTags
    Checks              api.HealthChecks
    Status              string
    Port                int
    Weights             api.AgentWeights
}

HealthService is a service entry in Consul.

type HealthServiceQuery Uses

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

HealthServiceQuery is the representation of all a service query in Consul.

func NewHealthConnectQuery Uses

func NewHealthConnectQuery(s string) (*HealthServiceQuery, error)

NewHealthConnect Query processes the strings to build a connect dependency.

func NewHealthServiceQuery Uses

func NewHealthServiceQuery(s string) (*HealthServiceQuery, error)

NewHealthServiceQuery processes the strings to build a service dependency.

func (*HealthServiceQuery) CanShare Uses

func (d *HealthServiceQuery) CanShare() bool

CanShare returns a boolean if this dependency is shareable.

func (*HealthServiceQuery) Fetch Uses

func (d *HealthServiceQuery) Fetch(clients *ClientSet, opts *QueryOptions) (interface{}, *ResponseMetadata, error)

Fetch queries the Consul API defined by the given client and returns a slice of HealthService objects.

func (*HealthServiceQuery) Stop Uses

func (d *HealthServiceQuery) Stop()

Stop halts the dependency's fetch function.

func (*HealthServiceQuery) String Uses

func (d *HealthServiceQuery) String() string

String returns the human-friendly version of this dependency.

func (*HealthServiceQuery) Type Uses

func (d *HealthServiceQuery) Type() Type

Type returns the type of this dependency.

type KVGetQuery Uses

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

KVGetQuery queries the KV store for a single key.

func NewKVGetQuery Uses

func NewKVGetQuery(s string) (*KVGetQuery, error)

NewKVGetQuery parses a string into a dependency.

func (*KVGetQuery) CanShare Uses

func (d *KVGetQuery) CanShare() bool

CanShare returns a boolean if this dependency is shareable.

func (*KVGetQuery) EnableBlocking Uses

func (d *KVGetQuery) EnableBlocking()

EnableBlocking turns this into a blocking KV query.

func (*KVGetQuery) Fetch Uses

func (d *KVGetQuery) Fetch(clients *ClientSet, opts *QueryOptions) (interface{}, *ResponseMetadata, error)

Fetch queries the Consul API defined by the given client.

func (*KVGetQuery) Stop Uses

func (d *KVGetQuery) Stop()

Stop halts the dependency's fetch function.

func (*KVGetQuery) String Uses

func (d *KVGetQuery) String() string

String returns the human-friendly version of this dependency.

func (*KVGetQuery) Type Uses

func (d *KVGetQuery) Type() Type

Type returns the type of this dependency.

type KVKeysQuery Uses

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

KVKeysQuery queries the KV store for a single key.

func NewKVKeysQuery Uses

func NewKVKeysQuery(s string) (*KVKeysQuery, error)

NewKVKeysQuery parses a string into a dependency.

func (*KVKeysQuery) CanShare Uses

func (d *KVKeysQuery) CanShare() bool

CanShare returns a boolean if this dependency is shareable.

func (*KVKeysQuery) Fetch Uses

func (d *KVKeysQuery) Fetch(clients *ClientSet, opts *QueryOptions) (interface{}, *ResponseMetadata, error)

Fetch queries the Consul API defined by the given client.

func (*KVKeysQuery) Stop Uses

func (d *KVKeysQuery) Stop()

Stop halts the dependency's fetch function.

func (*KVKeysQuery) String Uses

func (d *KVKeysQuery) String() string

String returns the human-friendly version of this dependency.

func (*KVKeysQuery) Type Uses

func (d *KVKeysQuery) Type() Type

Type returns the type of this dependency.

type KVListQuery Uses

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

KVListQuery queries the KV store for a single key.

func NewKVListQuery Uses

func NewKVListQuery(s string) (*KVListQuery, error)

NewKVListQuery parses a string into a dependency.

func (*KVListQuery) CanShare Uses

func (d *KVListQuery) CanShare() bool

CanShare returns a boolean if this dependency is shareable.

func (*KVListQuery) Fetch Uses

func (d *KVListQuery) Fetch(clients *ClientSet, opts *QueryOptions) (interface{}, *ResponseMetadata, error)

Fetch queries the Consul API defined by the given client.

func (*KVListQuery) Stop Uses

func (d *KVListQuery) Stop()

Stop halts the dependency's fetch function.

func (*KVListQuery) String Uses

func (d *KVListQuery) String() string

String returns the human-friendly version of this dependency.

func (*KVListQuery) Type Uses

func (d *KVListQuery) Type() Type

Type returns the type of this dependency.

type KeyPair Uses

type KeyPair struct {
    Path  string
    Key   string
    Value string

    // 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 Uses

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 QueryOptions Uses

type QueryOptions struct {
    AllowStale        bool
    Datacenter        string
    Near              string
    RequireConsistent bool
    VaultGrace        time.Duration
    WaitIndex         uint64
    WaitTime          time.Duration
}

QueryOptions is a list of options to send with the query. These options are client-agnostic, and the dependency determines which, if any, of the options to use.

func (*QueryOptions) Merge Uses

func (q *QueryOptions) Merge(o *QueryOptions) *QueryOptions

func (*QueryOptions) String Uses

func (q *QueryOptions) String() string

func (*QueryOptions) ToConsulOpts Uses

func (q *QueryOptions) ToConsulOpts() *consulapi.QueryOptions

type ResponseMetadata Uses

type ResponseMetadata struct {
    LastIndex   uint64
    LastContact time.Duration
    Block       bool
}

ResponseMetadata is a struct that contains metadata about the response. This is returned from a Fetch function call.

type Secret Uses

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 Uses

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 Uses

type SecretWrapInfo struct {
    Token           string
    TTL             int
    CreationTime    time.Time
    WrappedAccessor string
}

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.

type ServiceTags Uses

type ServiceTags []string

ServiceTags is a slice of tags assigned to a Service

type Set Uses

type Set struct {
    sync.RWMutex
    // contains filtered or unexported fields
}

Set is a dependency-specific set implementation. Relative ordering is preserved.

func (*Set) Add Uses

func (s *Set) Add(d Dependency) bool

Add adds a new element to the set if it does not already exist.

func (*Set) Get Uses

func (s *Set) Get(v string) Dependency

Get retrieves a single element from the set by name.

func (*Set) Len Uses

func (s *Set) Len() int

Len is the size of the set.

func (*Set) List Uses

func (s *Set) List() []Dependency

List returns the insertion-ordered list of dependencies.

func (*Set) String Uses

func (s *Set) String() string

String is a string representation of the set.

type Type Uses

type Type int
const (
    TypeConsul Type = iota
    TypeVault
    TypeLocal
)

type VaultAgentTokenQuery Uses

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

VaultAgentTokenQuery is the dependency to Vault Agent token

func NewVaultAgentTokenQuery Uses

func NewVaultAgentTokenQuery(path string) (*VaultAgentTokenQuery, error)

NewVaultAgentTokenQuery creates a new dependency.

func (*VaultAgentTokenQuery) CanShare Uses

func (d *VaultAgentTokenQuery) CanShare() bool

CanShare returns if this dependency is sharable.

func (*VaultAgentTokenQuery) Fetch Uses

func (d *VaultAgentTokenQuery) Fetch(clients *ClientSet, opts *QueryOptions) (interface{}, *ResponseMetadata, error)

Fetch retrieves this dependency and returns the result or any errors that occur in the process.

func (*VaultAgentTokenQuery) Stop Uses

func (d *VaultAgentTokenQuery) Stop()

Stop halts the dependency's fetch function.

func (*VaultAgentTokenQuery) String Uses

func (d *VaultAgentTokenQuery) String() string

String returns the human-friendly version of this dependency.

func (*VaultAgentTokenQuery) Type Uses

func (d *VaultAgentTokenQuery) Type() Type

Type returns the type of this dependency.

type VaultListQuery Uses

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

VaultListQuery is the dependency to Vault for a secret

func NewVaultListQuery Uses

func NewVaultListQuery(s string) (*VaultListQuery, error)

NewVaultListQuery creates a new datacenter dependency.

func (*VaultListQuery) CanShare Uses

func (d *VaultListQuery) CanShare() bool

CanShare returns if this dependency is shareable.

func (*VaultListQuery) Fetch Uses

func (d *VaultListQuery) Fetch(clients *ClientSet, opts *QueryOptions) (interface{}, *ResponseMetadata, error)

Fetch queries the Vault API

func (*VaultListQuery) Stop Uses

func (d *VaultListQuery) Stop()

Stop halts the given dependency's fetch.

func (*VaultListQuery) String Uses

func (d *VaultListQuery) String() string

String returns the human-friendly version of this dependency.

func (*VaultListQuery) Type Uses

func (d *VaultListQuery) Type() Type

Type returns the type of this dependency.

type VaultReadQuery Uses

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

VaultReadQuery is the dependency to Vault for a secret

func NewVaultReadQuery Uses

func NewVaultReadQuery(s string) (*VaultReadQuery, error)

NewVaultReadQuery creates a new datacenter dependency.

func (*VaultReadQuery) CanShare Uses

func (d *VaultReadQuery) CanShare() bool

CanShare returns if this dependency is shareable.

func (*VaultReadQuery) Fetch Uses

func (d *VaultReadQuery) Fetch(clients *ClientSet, opts *QueryOptions,
) (interface{}, *ResponseMetadata, error)

Fetch queries the Vault API

func (*VaultReadQuery) Stop Uses

func (d *VaultReadQuery) Stop()

Stop halts the given dependency's fetch.

func (*VaultReadQuery) String Uses

func (d *VaultReadQuery) String() string

String returns the human-friendly version of this dependency.

func (*VaultReadQuery) Type Uses

func (d *VaultReadQuery) Type() Type

Type returns the type of this dependency.

type VaultTokenQuery Uses

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

VaultTokenQuery is the dependency to Vault for a secret

func NewVaultTokenQuery Uses

func NewVaultTokenQuery(token string) (*VaultTokenQuery, error)

NewVaultTokenQuery creates a new dependency.

func (*VaultTokenQuery) CanShare Uses

func (d *VaultTokenQuery) CanShare() bool

CanShare returns if this dependency is shareable.

func (*VaultTokenQuery) Fetch Uses

func (d *VaultTokenQuery) Fetch(clients *ClientSet, opts *QueryOptions,
) (interface{}, *ResponseMetadata, error)

Fetch queries the Vault API

func (*VaultTokenQuery) Stop Uses

func (d *VaultTokenQuery) Stop()

Stop halts the dependency's fetch function.

func (*VaultTokenQuery) String Uses

func (d *VaultTokenQuery) String() string

String returns the human-friendly version of this dependency.

func (*VaultTokenQuery) Type Uses

func (d *VaultTokenQuery) Type() Type

Type returns the type of this dependency.

type VaultWriteQuery Uses

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

VaultWriteQuery is the dependency to Vault for a secret

func NewVaultWriteQuery Uses

func NewVaultWriteQuery(s string, d map[string]interface{}) (*VaultWriteQuery, error)

NewVaultWriteQuery creates a new datacenter dependency.

func (*VaultWriteQuery) CanShare Uses

func (d *VaultWriteQuery) CanShare() bool

CanShare returns if this dependency is shareable.

func (*VaultWriteQuery) Fetch Uses

func (d *VaultWriteQuery) Fetch(clients *ClientSet, opts *QueryOptions,
) (interface{}, *ResponseMetadata, error)

Fetch queries the Vault API

func (*VaultWriteQuery) Stop Uses

func (d *VaultWriteQuery) Stop()

Stop halts the given dependency's fetch.

func (*VaultWriteQuery) String Uses

func (d *VaultWriteQuery) String() string

String returns the human-friendly version of this dependency.

func (*VaultWriteQuery) Type Uses

func (d *VaultWriteQuery) Type() Type

Type returns the type of this dependency.

Package dependency imports 25 packages (graph) and is imported by 27 packages. Updated 2020-10-06. Refresh now. Tools for package owners.