dependency

package
v0.39.1 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: MPL-2.0 Imports: 31 Imported by: 158

Documentation

Index

Constants

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

	QueryNamespace     = "ns"
	QueryPartition     = "partition"
	QueryPeer          = "peer"
	QuerySamenessGroup = "sameness-group"

	NodeMaint    = "_node_maintenance"
	ServiceMaint = "_service_maintenance:"
)
View Source
const (
	// DefaultContextTimeout context wait timeout for blocking queries.
	DefaultContextTimeout = 60 * time.Second
)
View Source
const (
	DefaultNonBlockingQuerySleepTime = 15 * time.Second
)
View Source
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 = DefaultNonBlockingQuerySleepTime
)

Variables

View Source
var (
	// VaultDefaultLeaseDuration is the default lease duration in seconds.
	VaultDefaultLeaseDuration time.Duration

	VaultLeaseRenewalThreshold float64
)
View Source
var (

	// CatalogDatacentersQuerySleepTime is the amount of time to sleep between
	// queries, since the endpoint does not support blocking queries.
	CatalogDatacentersQuerySleepTime = DefaultNonBlockingQuerySleepTime
)
View Source
var (

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

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

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

	// CatalogServicesQueryRe is the regular expression to use for CatalogServicesQuery.
	CatalogServicesQueryRe = regexp.MustCompile(`\A` + queryRe + dcRe + `\z`)
)
View Source
var ErrContinue = errors.New("dependency continue")

ErrContinue is a special error which says to continue (retry) on error.

View Source
var ErrLeaseExpired = errors.New("lease expired or is not renewable")
View Source
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.

View Source
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
)
View Source
var (

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

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

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

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

	// ListPartitionsQuerySleepTime is the amount of time to sleep between
	// queries, since the endpoint does not support blocking queries.
	ListPartitionsQuerySleepTime = DefaultNonBlockingQuerySleepTime
)

Ensure implements

View Source
var (

	// ListPeeringQueryRe is the regular expression to use.
	ListPeeringQueryRe = regexp.MustCompile(`\A` + queryRe + `\z`)
)
View Source
var (

	// NVGetQueryRe is the regular expression to use.
	NVGetQueryRe = regexp.MustCompile(`\A` + nvPathRe + nvNamespaceRe + nvRegionRe + `\z`)
)
View Source
var (

	// NVListQueryRe is the regular expression to use.
	NVListQueryRe = regexp.MustCompile(`\A` + nvListPrefixRe + nvListNSRe + nvRegionRe + `\z`)
)
View Source
var (

	// NomadServiceQueryRe is the regex that is used to understand a service
	// specific Nomad query.
	//
	// e.g. "<tag=value>.<name>@<region>"
	NomadServiceQueryRe = regexp.MustCompile(`\A` + tagRe + serviceNameRe + regionRe + `\z`)
)
View Source
var (

	// NomadServicesQueryRe is the regex that is used to understand a service
	// listing Nomad query.
	NomadServicesQueryRe = regexp.MustCompile(`\A` + regionRe + `\z`)
)

Functions

func GetConsulQueryOpts added in v0.36.0

func GetConsulQueryOpts(queryMap map[string]string, endpointLabel string) (url.Values, error)

GetConsulQueryOpts parses optional consul query params into key pairs. supports namespace, peer and partition params

func SetVaultDefaultLeaseDuration added in v0.26.0

func SetVaultDefaultLeaseDuration(t time.Duration)

Make sure to only set VaultDefaultLeaseDuration once

func SetVaultLeaseRenewalThreshold added in v0.28.1

func SetVaultLeaseRenewalThreshold(f float64)

Make sure to only set VaultLeaseRenewalThreshold once

Types

type ByName added in v0.18.0

type ByName []*CatalogSnippet

ByName is a sortable slice of CatalogService structs.

func (ByName) Len added in v0.18.0

func (s ByName) Len() int

func (ByName) Less added in v0.18.0

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

func (ByName) Swap added in v0.18.0

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

type ByNode added in v0.18.0

type ByNode []*Node

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

func (ByNode) Len added in v0.18.0

func (s ByNode) Len() int

func (ByNode) Less added in v0.18.0

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

func (ByNode) Swap added in v0.18.0

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

type ByNodeThenID added in v0.18.0

type ByNodeThenID []*HealthService

ByNodeThenID is a sortable slice of Service

func (ByNodeThenID) Len added in v0.18.0

func (s ByNodeThenID) Len() int

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

func (ByNodeThenID) Less added in v0.18.0

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

func (ByNodeThenID) Swap added in v0.18.0

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

type ByPeer added in v0.37.0

type ByPeer []*Peering

ByPeer is a sortable list of peerings in this order: 1. State 2. Partition 3. Name

func (ByPeer) Len added in v0.37.0

func (p ByPeer) Len() int

func (ByPeer) Less added in v0.37.0

func (p ByPeer) Less(i, j int) bool

Less if peer names are cluster-2, cluster-12, cluster-1 our sorting will be cluster-1, cluster-12, cluster-2

func (ByPeer) Swap added in v0.37.0

func (p ByPeer) Swap(i, j int)

type ByService added in v0.18.0

type ByService []*CatalogNodeService

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

func (ByService) Len added in v0.18.0

func (s ByService) Len() int

func (ByService) Less added in v0.18.0

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

func (ByService) Swap added in v0.18.0

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

type CatalogDatacentersQuery added in v0.18.0

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

CatalogDatacentersQuery is the dependency to query all datacenters

func NewCatalogDatacentersQuery added in v0.18.0

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

NewCatalogDatacentersQuery creates a new datacenter dependency.

func (*CatalogDatacentersQuery) CanShare added in v0.18.0

func (d *CatalogDatacentersQuery) CanShare() bool

CanShare returns if this dependency is shareable.

func (*CatalogDatacentersQuery) Fetch added in v0.18.0

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 added in v0.18.0

func (d *CatalogDatacentersQuery) Stop()

Stop terminates this dependency's fetch.

func (*CatalogDatacentersQuery) String added in v0.18.0

func (d *CatalogDatacentersQuery) String() string

String returns the human-friendly version of this dependency.

func (*CatalogDatacentersQuery) Type added in v0.18.0

func (d *CatalogDatacentersQuery) Type() Type

Type returns the type of this dependency.

type CatalogNode added in v0.10.0

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

CatalogNode is a wrapper around the node and its services.

type CatalogNodeQuery added in v0.18.0

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

CatalogNodeQuery represents a single node from the Consul catalog.

func NewCatalogNodeQuery added in v0.18.0

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 added in v0.18.0

func (d *CatalogNodeQuery) CanShare() bool

CanShare returns a boolean if this dependency is shareable.

func (*CatalogNodeQuery) Fetch added in v0.18.0

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 added in v0.18.0

func (d *CatalogNodeQuery) Stop()

Stop halts the dependency's fetch function.

func (*CatalogNodeQuery) String added in v0.18.0

func (d *CatalogNodeQuery) String() string

String returns the human-friendly version of this dependency.

func (*CatalogNodeQuery) Type added in v0.18.0

func (d *CatalogNodeQuery) Type() Type

Type returns the type of this dependency.

type CatalogNodeService added in v0.18.0

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 added in v0.18.0

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

CatalogNodesQuery is the representation of all registered nodes in Consul.

func NewCatalogNodesQuery added in v0.18.0

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 added in v0.18.0

func (d *CatalogNodesQuery) CanShare() bool

CanShare returns a boolean if this dependency is shareable.

func (*CatalogNodesQuery) Fetch added in v0.18.0

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 added in v0.18.0

func (d *CatalogNodesQuery) Stop()

Stop halts the dependency's fetch function.

func (*CatalogNodesQuery) String added in v0.18.0

func (d *CatalogNodesQuery) String() string

String returns the human-friendly version of this dependency.

func (*CatalogNodesQuery) Type added in v0.18.0

func (d *CatalogNodesQuery) Type() Type

Type returns the type of this dependency.

type CatalogService

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 added in v0.18.0

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

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

func NewCatalogServiceQuery added in v0.18.0

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

NewCatalogServiceQuery parses a string into a CatalogServiceQuery.

func (*CatalogServiceQuery) CanShare added in v0.18.0

func (d *CatalogServiceQuery) CanShare() bool

CanShare returns a boolean if this dependency is shareable.

func (*CatalogServiceQuery) Fetch added in v0.18.0

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 added in v0.18.0

func (d *CatalogServiceQuery) Stop()

Stop halts the dependency's fetch function.

func (*CatalogServiceQuery) String added in v0.18.0

func (d *CatalogServiceQuery) String() string

String returns the human-friendly version of this dependency.

func (*CatalogServiceQuery) Type added in v0.18.0

func (d *CatalogServiceQuery) Type() Type

Type returns the type of this dependency.

type CatalogServicesQuery added in v0.18.0

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

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

func NewCatalogServicesQuery added in v0.18.0

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

NewCatalogServicesQuery parses a string of the format @dc.

func (*CatalogServicesQuery) CanShare added in v0.18.0

func (d *CatalogServicesQuery) CanShare() bool

CanShare returns a boolean if this dependency is shareable.

func (*CatalogServicesQuery) Fetch added in v0.18.0

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 added in v0.18.0

func (d *CatalogServicesQuery) Stop()

Stop halts the dependency's fetch function.

func (*CatalogServicesQuery) String added in v0.18.0

func (d *CatalogServicesQuery) String() string

String returns the human-friendly version of this dependency.

func (*CatalogServicesQuery) Type added in v0.18.0

func (d *CatalogServicesQuery) Type() Type

Type returns the type of this dependency.

type CatalogSnippet added in v0.18.0

type CatalogSnippet struct {
	Name string
	Tags ServiceTags
}

CatalogSnippet is a catalog entry in Consul.

type ClientSet added in v0.9.0

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 added in v0.9.0

func NewClientSet() *ClientSet

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

func (*ClientSet) Consul added in v0.9.0

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

Consul returns the Consul client for this set.

func (*ClientSet) CreateConsulClient added in v0.15.0

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

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

func (*ClientSet) CreateNomadClient added in v0.29.0

func (c *ClientSet) CreateNomadClient(i *CreateNomadClientInput) error

CreateNomadClient creates a new Nomad API client from the given input.

func (*ClientSet) CreateVaultClient added in v0.15.0

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

func (*ClientSet) Nomad added in v0.29.0

func (c *ClientSet) Nomad() *nomadapi.Client

Nomad returns the Nomad client for this set.

func (*ClientSet) Stop added in v0.15.0

func (c *ClientSet) Stop()

Stop closes all idle connections for any attached clients.

func (*ClientSet) Vault added in v0.9.0

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

Vault returns the Vault client for this set.

type ConnectCAQuery added in v0.23.0

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

func NewConnectCAQuery added in v0.23.0

func NewConnectCAQuery() *ConnectCAQuery

func (*ConnectCAQuery) CanShare added in v0.23.0

func (d *ConnectCAQuery) CanShare() bool

func (*ConnectCAQuery) Fetch added in v0.23.0

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

func (*ConnectCAQuery) Stop added in v0.23.0

func (d *ConnectCAQuery) Stop()

func (*ConnectCAQuery) String added in v0.23.0

func (d *ConnectCAQuery) String() string

func (*ConnectCAQuery) Type added in v0.23.0

func (d *ConnectCAQuery) Type() Type

type ConnectLeafQuery added in v0.23.0

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

func NewConnectLeafQuery added in v0.23.0

func NewConnectLeafQuery(service string) *ConnectLeafQuery

func (*ConnectLeafQuery) CanShare added in v0.23.0

func (d *ConnectLeafQuery) CanShare() bool

func (*ConnectLeafQuery) Fetch added in v0.23.0

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

func (*ConnectLeafQuery) Stop added in v0.23.0

func (d *ConnectLeafQuery) Stop()

func (*ConnectLeafQuery) String added in v0.23.0

func (d *ConnectLeafQuery) String() string

func (*ConnectLeafQuery) Type added in v0.23.0

func (d *ConnectLeafQuery) Type() Type

type CreateConsulClientInput added in v0.15.0

type CreateConsulClientInput struct {
	Address      string
	Namespace    string
	Token        string
	TokenFile    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 CreateNomadClientInput added in v0.29.0

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

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

CreateNomadClientInput is used as input to the CreateNomadClient function.

type CreateVaultClientInput added in v0.15.0

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

	K8SAuthRoleName            string
	K8SServiceAccountTokenPath string
	K8SServiceAccountToken     string
	K8SServiceMountPath        string

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

CreateVaultClientInput is used as input to the CreateVaultClient function.

type Dependency

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

	// String is used to uniquely identify a dependency. If a dependency receives arguments and
	// may be used multiple times w/ different args, then it should make sure to differentiate
	// itself based on those args; otherwise, only one instance of the dependency will be created.
	//
	// For example: Calling the exportedServices func multiple times in a template for different
	// partitions will result in the first partition provided being used repeatedly - regardless of the
	// partition provided in later calls - if the partition name is not included in the output of String.
	String() string

	Stop()
	Type() Type
}

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

type ExportedService added in v0.38.0

type ExportedService struct {
	// Name of the service
	Service string

	// Partition of the service
	Partition string

	// Namespace of the service
	Namespace string

	// Consumers is a list of downstream consumers of the service.
	Consumers ResolvedConsumers
}

type FileQuery added in v0.18.0

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

FileQuery represents a local file dependency.

func NewFileQuery added in v0.18.0

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

NewFileQuery creates a file dependency from the given path.

func (*FileQuery) CanShare added in v0.18.0

func (d *FileQuery) CanShare() bool

CanShare returns a boolean if this dependency is shareable.

func (*FileQuery) Fetch added in v0.18.0

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 added in v0.18.0

func (d *FileQuery) Stop()

Stop halts the dependency's fetch function.

func (*FileQuery) String added in v0.18.0

func (d *FileQuery) String() string

String returns the human-friendly version of this dependency.

func (*FileQuery) Type added in v0.18.0

func (d *FileQuery) Type() Type

Type returns the type of this dependency.

type HealthService

type HealthService struct {
	Node                   string
	NodeID                 string
	NodeAddress            string
	NodeTaggedAddresses    map[string]string
	NodeMeta               map[string]string
	ServiceMeta            map[string]string
	Address                string
	ServiceTaggedAddresses map[string]api.ServiceAddress
	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 added in v0.18.0

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

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

func NewHealthConnectQuery added in v0.23.0

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

NewHealthConnect Query processes the strings to build a connect dependency.

func NewHealthServiceQuery added in v0.18.0

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

NewHealthServiceQuery processes the strings to build a service dependency.

func (*HealthServiceQuery) CanShare added in v0.18.0

func (d *HealthServiceQuery) CanShare() bool

CanShare returns a boolean if this dependency is shareable.

func (*HealthServiceQuery) Fetch added in v0.18.0

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 added in v0.18.0

func (d *HealthServiceQuery) Stop()

Stop halts the dependency's fetch function.

func (*HealthServiceQuery) String added in v0.18.0

func (d *HealthServiceQuery) String() string

String returns the human-friendly version of this dependency.

func (*HealthServiceQuery) Type added in v0.18.0

func (d *HealthServiceQuery) Type() Type

Type returns the type of this dependency.

type KVGetQuery added in v0.18.0

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

KVGetQuery queries the KV store for a single key.

func NewKVGetQuery added in v0.18.0

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

NewKVGetQuery parses a string into a dependency.

func (*KVGetQuery) CanShare added in v0.18.0

func (d *KVGetQuery) CanShare() bool

CanShare returns a boolean if this dependency is shareable.

func (*KVGetQuery) EnableBlocking added in v0.18.0

func (d *KVGetQuery) EnableBlocking()

EnableBlocking turns this into a blocking KV query.

func (*KVGetQuery) Fetch added in v0.18.0

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

Fetch queries the Consul API defined by the given client.

func (*KVGetQuery) Stop added in v0.18.0

func (d *KVGetQuery) Stop()

Stop halts the dependency's fetch function.

func (*KVGetQuery) String added in v0.18.0

func (d *KVGetQuery) String() string

String returns the human-friendly version of this dependency.

func (*KVGetQuery) Type added in v0.18.0

func (d *KVGetQuery) Type() Type

Type returns the type of this dependency.

type KVKeysQuery added in v0.18.0

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

KVKeysQuery queries the KV store for a single key.

func NewKVKeysQuery added in v0.18.0

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

NewKVKeysQuery parses a string into a dependency.

func (*KVKeysQuery) CanShare added in v0.18.0

func (d *KVKeysQuery) CanShare() bool

CanShare returns a boolean if this dependency is shareable.

func (*KVKeysQuery) Fetch added in v0.18.0

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

Fetch queries the Consul API defined by the given client.

func (*KVKeysQuery) Stop added in v0.18.0

func (d *KVKeysQuery) Stop()

Stop halts the dependency's fetch function.

func (*KVKeysQuery) String added in v0.18.0

func (d *KVKeysQuery) String() string

String returns the human-friendly version of this dependency.

func (*KVKeysQuery) Type added in v0.18.0

func (d *KVKeysQuery) Type() Type

Type returns the type of this dependency.

type KVListQuery added in v0.18.0

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

KVListQuery queries the KV store for a single key.

func NewKVListQuery added in v0.18.0

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

NewKVListQuery parses a string into a dependency.

func (*KVListQuery) CanShare added in v0.18.0

func (d *KVListQuery) CanShare() bool

CanShare returns a boolean if this dependency is shareable.

func (*KVListQuery) Fetch added in v0.18.0

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

Fetch queries the Consul API defined by the given client.

func (*KVListQuery) Stop added in v0.18.0

func (d *KVListQuery) Stop()

Stop halts the dependency's fetch function.

func (*KVListQuery) String added in v0.18.0

func (d *KVListQuery) String() string

String returns the human-friendly version of this dependency.

func (*KVListQuery) Type added in v0.18.0

func (d *KVListQuery) Type() Type

Type returns the type of this dependency.

type KeyPair

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 ListExportedServicesQuery added in v0.38.0

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

ListExportedServicesQuery is the representation of a requested exported services dependency from inside a template.

func NewListExportedServicesQuery added in v0.38.0

func NewListExportedServicesQuery(s string) (*ListExportedServicesQuery, error)

NewListExportedServicesQuery parses a string of the format @dc.

func (*ListExportedServicesQuery) CanShare added in v0.38.0

func (c *ListExportedServicesQuery) CanShare() bool

CanShare returns if this dependency is shareable when consul-template is running in de-duplication mode.

func (*ListExportedServicesQuery) Fetch added in v0.38.0

func (c *ListExportedServicesQuery) Fetch(clients *ClientSet, opts *QueryOptions) (interface{}, *ResponseMetadata, error)

func (*ListExportedServicesQuery) Stop added in v0.38.0

func (c *ListExportedServicesQuery) Stop()

func (*ListExportedServicesQuery) String added in v0.38.0

func (c *ListExportedServicesQuery) String() string

func (*ListExportedServicesQuery) Type added in v0.38.0

func (c *ListExportedServicesQuery) Type() Type

type ListPartitionsQuery added in v0.38.0

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

ListPartitionsQuery is the representation of a requested partitions dependency from inside a template.

func NewListPartitionsQuery added in v0.38.0

func NewListPartitionsQuery() (*ListPartitionsQuery, error)

func (*ListPartitionsQuery) CanShare added in v0.38.0

func (c *ListPartitionsQuery) CanShare() bool

CanShare returns if this dependency is shareable when consul-template is running in de-duplication mode.

func (*ListPartitionsQuery) Fetch added in v0.38.0

func (c *ListPartitionsQuery) Fetch(clients *ClientSet, opts *QueryOptions) (interface{}, *ResponseMetadata, error)

func (*ListPartitionsQuery) Stop added in v0.38.0

func (c *ListPartitionsQuery) Stop()

func (*ListPartitionsQuery) String added in v0.38.0

func (c *ListPartitionsQuery) String() string

func (*ListPartitionsQuery) Type added in v0.38.0

func (c *ListPartitionsQuery) Type() Type

type ListPeeringQuery added in v0.37.0

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

ListPeeringQuery fetches all peering for a Consul cluster. https://developer.hashicorp.com/consul/api-docs/peering#list-all-peerings

func NewListPeeringQuery added in v0.37.0

func NewListPeeringQuery(s string) (*ListPeeringQuery, error)

func (*ListPeeringQuery) CanShare added in v0.37.0

func (l *ListPeeringQuery) CanShare() bool

func (*ListPeeringQuery) Fetch added in v0.37.0

func (l *ListPeeringQuery) Fetch(clients *ClientSet, opts *QueryOptions) (interface{}, *ResponseMetadata, error)

func (*ListPeeringQuery) Stop added in v0.37.0

func (l *ListPeeringQuery) Stop()

func (*ListPeeringQuery) String added in v0.37.0

func (l *ListPeeringQuery) String() string

func (*ListPeeringQuery) Type added in v0.37.0

func (l *ListPeeringQuery) Type() Type

type NVGetQuery added in v0.29.6

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

NVGetQuery queries the KV store for a single key.

func NewNVGetQuery added in v0.29.6

func NewNVGetQuery(ns, s string) (*NVGetQuery, error)

NewNVGetQuery parses a string into a dependency.

func (*NVGetQuery) CanShare added in v0.29.6

func (d *NVGetQuery) CanShare() bool

CanShare returns a boolean if this dependency is shareable.

func (*NVGetQuery) EnableBlocking added in v0.29.6

func (d *NVGetQuery) EnableBlocking()

EnableBlocking turns this into a blocking KV query.

func (*NVGetQuery) Fetch added in v0.29.6

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

Fetch queries the Nomad API defined by the given client.

func (*NVGetQuery) Stop added in v0.29.6

func (d *NVGetQuery) Stop()

Stop halts the dependency's fetch function.

func (*NVGetQuery) String added in v0.29.6

func (d *NVGetQuery) String() string

String returns the human-friendly version of this dependency. This value is also used to disambiguate multiple instances in the Brain

func (*NVGetQuery) Type added in v0.29.6

func (d *NVGetQuery) Type() Type

Type returns the type of this dependency.

type NVListQuery added in v0.29.6

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

NVListQuery queries the SV store for the metadata for keys matching the given prefix.

func NewNVListQuery added in v0.29.6

func NewNVListQuery(ns, s string) (*NVListQuery, error)

NewNVListQuery parses a string into a dependency.

func (*NVListQuery) CanShare added in v0.29.6

func (d *NVListQuery) CanShare() bool

CanShare returns a boolean if this dependency is shareable.

func (*NVListQuery) Fetch added in v0.29.6

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

Fetch queries the Nomad API defined by the given client.

func (*NVListQuery) Stop added in v0.29.6

func (d *NVListQuery) Stop()

Stop halts the dependency's fetch function.

func (*NVListQuery) String added in v0.29.6

func (d *NVListQuery) String() string

String returns the human-friendly version of this dependency.

func (*NVListQuery) Type added in v0.29.6

func (d *NVListQuery) Type() Type

Type returns the type of this dependency.

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 NomadService added in v0.29.0

type NomadService struct {
	ID         string
	Name       string
	Node       string
	Address    string
	Port       int
	Datacenter string
	Tags       ServiceTags
	JobID      string
	AllocID    string
}

NomadService is a fully hydrated service registration response from the mirroring the Nomad API response object.

type NomadServiceByName added in v0.29.0

type NomadServiceByName []*NomadService

NomadServiceByName is a sortable slice of NomadService structs.

func (NomadServiceByName) Len added in v0.29.0

func (s NomadServiceByName) Len() int

func (NomadServiceByName) Less added in v0.29.0

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

func (NomadServiceByName) Swap added in v0.29.0

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

type NomadServiceQuery added in v0.29.0

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

NomadServiceQuery is the representation of a requested Nomad services dependency from inside a template.

func NewNomadServiceChooseQuery added in v0.29.1

func NewNomadServiceChooseQuery(count int, key, s string) (*NomadServiceQuery, error)

NewNomadServiceChooseQuery parses s using NewNomadServiceQuery, and then also configures the resulting query with the choose parameter set according to the count and key arguments.

func NewNomadServiceQuery added in v0.29.0

func NewNomadServiceQuery(s string) (*NomadServiceQuery, error)

NewNomadServiceQuery parses a string into a NomadServiceQuery which is used to list services registered within Nomad which match a particular name.

func (*NomadServiceQuery) CanShare added in v0.29.0

func (d *NomadServiceQuery) CanShare() bool

func (*NomadServiceQuery) Fetch added in v0.29.0

func (d *NomadServiceQuery) Fetch(client *ClientSet, opts *QueryOptions) (interface{}, *ResponseMetadata, error)

Fetch queries the Nomad API defined by the given client and returns a slice of NomadService objects.

func (*NomadServiceQuery) Stop added in v0.29.0

func (d *NomadServiceQuery) Stop()

Stop halts the dependency's fetch function.

func (*NomadServiceQuery) String added in v0.29.0

func (d *NomadServiceQuery) String() string

func (*NomadServiceQuery) Type added in v0.29.0

func (d *NomadServiceQuery) Type() Type

Type returns the type of this dependency.

type NomadServicesQuery added in v0.29.0

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

NomadServicesQuery is the representation of a requested Nomad service dependency from inside a template.

func NewNomadServicesQuery added in v0.29.0

func NewNomadServicesQuery(s string) (*NomadServicesQuery, error)

NewNomadServicesQuery parses a string into a NomadServicesQuery which is used to list services registered within Nomad.

func (*NomadServicesQuery) CanShare added in v0.29.0

func (*NomadServicesQuery) CanShare() bool

CanShare returns true since Nomad service dependencies are shareable.

func (*NomadServicesQuery) Fetch added in v0.29.0

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

Fetch queries the Nomad API defined by the given client and returns a slice of NomadServiceSnippet objects.

func (*NomadServicesQuery) Stop added in v0.29.0

func (d *NomadServicesQuery) Stop()

Stop halts the dependency's fetch function.

func (*NomadServicesQuery) String added in v0.29.0

func (d *NomadServicesQuery) String() string

String returns the human-friendly version of this dependency.

func (*NomadServicesQuery) Type added in v0.29.0

func (d *NomadServicesQuery) Type() Type

Type returns the type of this dependency.

type NomadServicesSnippet added in v0.29.0

type NomadServicesSnippet struct {
	Name string
	Tags ServiceTags
}

NomadServicesSnippet is a stub service entry in Nomad.

type NomadVarItem added in v0.29.6

type NomadVarItem struct {
	Key, Value string
	// contains filtered or unexported fields
}

NomadVarItem enriches the basic string values in a api.Variable's Items map with additional helper funcs for formatting and access to its parent item. This enables us to have the template funcs start at the Items collection without the user having to delve to it themselves and to minimize the number of template funcs that we have to provide for coverage.

func (NomadVarItem) MarshalJSON added in v0.29.6

func (v NomadVarItem) MarshalJSON() ([]byte, error)

func (NomadVarItem) Metadata added in v0.29.6

func (v NomadVarItem) Metadata() *NomadVarMeta

func (NomadVarItem) Parent added in v0.29.6

func (v NomadVarItem) Parent() *NomadVariable

func (NomadVarItem) String added in v0.29.6

func (v NomadVarItem) String() string

type NomadVarItems added in v0.29.6

type NomadVarItems map[string]NomadVarItem

func (NomadVarItems) ItemsMap added in v0.29.6

func (i NomadVarItems) ItemsMap() map[string]interface{}

func (NomadVarItems) Keys added in v0.29.6

func (v NomadVarItems) Keys() []string

Keys returns a sorted list of the Item map's keys.

func (NomadVarItems) Metadata added in v0.29.6

func (i NomadVarItems) Metadata() *NomadVarMeta

Metadata returns this item's parent's metadata

func (NomadVarItems) Parent added in v0.29.6

func (i NomadVarItems) Parent() *NomadVariable

Parent returns the item's container object

func (NomadVarItems) Tuples added in v0.29.6

func (v NomadVarItems) Tuples() []struct{ K, V string }

Tuples produces a key-sorted list of K,V tuple structs from the Items map's values

func (NomadVarItems) Values added in v0.29.6

func (v NomadVarItems) Values() []string

Values produces a key-sorted list of the Items map's values

type NomadVarMeta added in v0.29.6

type NomadVarMeta struct {
	Namespace, Path          string
	CreateIndex, ModifyIndex uint64
	CreateTime, ModifyTime   nanoTime
}

NomadVarMeta provides the same fields as api.VariableMetadata but aliases the times into a more template friendly alternative.

func NewNomadVarMeta added in v0.29.6

func NewNomadVarMeta(in *api.VariableMetadata) *NomadVarMeta

NewNomadVarMeta is used to create a NomadVarMeta from a Nomad API VariableMetadata response.

func (NomadVarMeta) String added in v0.29.6

func (s NomadVarMeta) String() string

type NomadVariable added in v0.29.6

type NomadVariable struct {
	Namespace, Path          string
	CreateIndex, ModifyIndex uint64
	CreateTime, ModifyTime   nanoTime
	Items                    NomadVarItems
	// contains filtered or unexported fields
}

NomadVariable is a template friendly container struct that allows for the NomadVar funcs to start inside of Items and have a rational way back up to the Variable that is JSON structurally equivalent to the API response. This struct's zero value is not trivially usable and should be created with NewNomadVariable--especially when outside of the dependency package as there is no access to nVar.

func NewNomadVariable added in v0.29.6

func NewNomadVariable(in *api.Variable) *NomadVariable

NewNomadVariable is used to create a NomadVariable from a Nomad API Variable response.

func (NomadVariable) Metadata added in v0.29.6

func (cv NomadVariable) Metadata() *NomadVarMeta

type Partition added in v0.38.0

type Partition struct {
	Name        string
	Description string
}

Partition is a partition in Consul.

type Peering added in v0.37.0

type Peering struct {
	ID                  string
	Name                string
	Partition           string
	Meta                map[string]string
	PeeringState        string
	PeerID              string
	PeerServerName      string
	PeerServerAddresses []string
	StreamStatus        PeeringStreamStatus
	Remote              PeeringRemoteInfo
}

Peering represent the response of the Consul peering API.

type PeeringRemoteInfo added in v0.37.0

type PeeringRemoteInfo struct {
	Partition  string
	Datacenter string
}

type PeeringStreamStatus added in v0.37.0

type PeeringStreamStatus struct {
	ImportedServices []string
	ExportedServices []string
	LastHeartbeat    *time.Time
	LastReceive      *time.Time
	LastSend         *time.Time
}

type PemEncoded added in v0.29.1

type PemEncoded struct {
	Cert, Key, CA string
	CAChain       []string
}

Return type containing PEMs as strings

func (PemEncoded) CaChainContains added in v0.39.1

func (a PemEncoded) CaChainContains(item string) bool

func (PemEncoded) Data added in v0.29.1

func (a PemEncoded) Data() PemEncoded

a wrapper to mimic v2 secrets Data wrapper

func (PemEncoded) Equals added in v0.39.1

func (a PemEncoded) Equals(b PemEncoded) bool

type QueryOptions added in v0.9.0

type QueryOptions struct {
	AllowStale          bool
	Datacenter          string
	Region              string
	Near                string
	Choose              string
	RequireConsistent   bool
	VaultGrace          time.Duration
	WaitIndex           uint64
	WaitTime            time.Duration
	ConsulPeer          string
	ConsulPartition     string
	ConsulNamespace     string
	ConsulSamenessGroup string
}

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 added in v0.18.0

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

func (*QueryOptions) String added in v0.18.0

func (q *QueryOptions) String() string

func (*QueryOptions) ToConsulOpts added in v0.18.0

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

func (*QueryOptions) ToNomadOpts added in v0.29.0

func (q *QueryOptions) ToNomadOpts() *nomadapi.QueryOptions

type ResolvedConsumers added in v0.38.0

type ResolvedConsumers struct {
	Peers      []string
	Partitions []string
}

type ResponseMetadata added in v0.9.0

type ResponseMetadata struct {
	LastIndex   uint64
	LastContact time.Duration
	BlockOnNil  bool // keep blocking on `nil` data returns
}

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

type Secret added in v0.9.0

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 added in v0.19.1

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 added in v0.19.1

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

type ServiceTags []string

ServiceTags is a slice of tags assigned to a Service

type Set added in v0.18.0

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

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

func (*Set) Add added in v0.18.0

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

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

func (*Set) Get added in v0.18.0

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

Get retrieves a single element from the set by name.

func (*Set) Len added in v0.18.0

func (s *Set) Len() int

Len is the size of the set.

func (*Set) List added in v0.18.0

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

List returns the insertion-ordered list of dependencies.

func (*Set) String added in v0.18.0

func (s *Set) String() string

String is a string representation of the set.

type TransportDialer added in v0.27.2

type TransportDialer interface {
	// Dial is intended to match https://pkg.go.dev/net#Dialer.Dial
	Dial(network, address string) (net.Conn, error)

	// DialContext is intended to match https://pkg.go.dev/net#Dialer.DialContext
	DialContext(ctx context.Context, network, address string) (net.Conn, error)
}

TransportDialer is an interface that allows passing a custom dialer function to an HTTP client's transport config

type Type added in v0.18.0

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

type VaultAgentTokenQuery added in v0.20.0

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

VaultAgentTokenQuery is the dependency to Vault Agent token

func NewVaultAgentTokenQuery added in v0.20.0

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

NewVaultAgentTokenQuery creates a new dependency.

func (*VaultAgentTokenQuery) CanShare added in v0.20.0

func (d *VaultAgentTokenQuery) CanShare() bool

CanShare returns if this dependency is sharable.

func (*VaultAgentTokenQuery) Fetch added in v0.20.0

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 added in v0.20.0

func (d *VaultAgentTokenQuery) Stop()

Stop halts the dependency's fetch function.

func (*VaultAgentTokenQuery) String added in v0.20.0

func (d *VaultAgentTokenQuery) String() string

String returns the human-friendly version of this dependency.

func (*VaultAgentTokenQuery) Type added in v0.20.0

func (d *VaultAgentTokenQuery) Type() Type

Type returns the type of this dependency.

type VaultListQuery added in v0.18.0

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

VaultListQuery is the dependency to Vault for a secret

func NewVaultListQuery added in v0.18.0

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

NewVaultListQuery creates a new datacenter dependency.

func (*VaultListQuery) CanShare added in v0.18.0

func (d *VaultListQuery) CanShare() bool

CanShare returns if this dependency is shareable.

func (*VaultListQuery) Fetch added in v0.18.0

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

Fetch queries the Vault API

func (*VaultListQuery) Stop added in v0.18.0

func (d *VaultListQuery) Stop()

Stop halts the given dependency's fetch.

func (*VaultListQuery) String added in v0.18.0

func (d *VaultListQuery) String() string

String returns the human-friendly version of this dependency.

func (*VaultListQuery) Type added in v0.18.0

func (d *VaultListQuery) Type() Type

Type returns the type of this dependency.

type VaultPKIQuery added in v0.29.0

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

VaultPKIQuery is the dependency to Vault for a secret

func NewVaultPKIQuery added in v0.29.0

func NewVaultPKIQuery(urlpath, filepath string, data map[string]interface{}) (*VaultPKIQuery, error)

NewVaultReadQuery creates a new datacenter dependency.

func (*VaultPKIQuery) CanShare added in v0.29.0

func (d *VaultPKIQuery) CanShare() bool

CanShare returns if this dependency is shareable.

func (*VaultPKIQuery) Fetch added in v0.29.0

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

Fetch queries the Vault API

func (*VaultPKIQuery) Stop added in v0.29.0

func (d *VaultPKIQuery) Stop()

Stop halts the given dependency's fetch.

func (*VaultPKIQuery) String added in v0.29.0

func (d *VaultPKIQuery) String() string

String returns the human-friendly version of this dependency.

func (*VaultPKIQuery) Type added in v0.29.0

func (d *VaultPKIQuery) Type() Type

Type returns the type of this dependency.

type VaultReadQuery added in v0.18.0

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

VaultReadQuery is the dependency to Vault for a secret

func NewVaultReadQuery added in v0.18.0

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

NewVaultReadQuery creates a new datacenter dependency.

func (*VaultReadQuery) CanShare added in v0.18.0

func (d *VaultReadQuery) CanShare() bool

CanShare returns if this dependency is shareable.

func (*VaultReadQuery) Fetch added in v0.18.0

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

Fetch queries the Vault API

func (*VaultReadQuery) Stop added in v0.18.0

func (d *VaultReadQuery) Stop()

Stop halts the given dependency's fetch.

func (*VaultReadQuery) String added in v0.18.0

func (d *VaultReadQuery) String() string

String returns the human-friendly version of this dependency.

func (*VaultReadQuery) Type added in v0.18.0

func (d *VaultReadQuery) Type() Type

Type returns the type of this dependency.

type VaultTokenQuery added in v0.18.0

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

VaultTokenQuery is the dependency to Vault for a secret

func NewVaultTokenQuery added in v0.18.0

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

NewVaultTokenQuery creates a new dependency.

func (*VaultTokenQuery) CanShare added in v0.18.0

func (d *VaultTokenQuery) CanShare() bool

CanShare returns if this dependency is shareable.

func (*VaultTokenQuery) Fetch added in v0.18.0

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

Fetch queries the Vault API

func (*VaultTokenQuery) Stop added in v0.18.0

func (d *VaultTokenQuery) Stop()

Stop halts the dependency's fetch function.

func (*VaultTokenQuery) String added in v0.18.0

func (d *VaultTokenQuery) String() string

String returns the human-friendly version of this dependency.

func (*VaultTokenQuery) Type added in v0.18.0

func (d *VaultTokenQuery) Type() Type

Type returns the type of this dependency.

type VaultWriteQuery added in v0.18.0

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

VaultWriteQuery is the dependency to Vault for a secret

func NewVaultWriteQuery added in v0.18.0

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

NewVaultWriteQuery creates a new datacenter dependency.

func (*VaultWriteQuery) CanShare added in v0.18.0

func (d *VaultWriteQuery) CanShare() bool

CanShare returns if this dependency is shareable.

func (*VaultWriteQuery) Fetch added in v0.18.0

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

Fetch queries the Vault API

func (*VaultWriteQuery) Stop added in v0.18.0

func (d *VaultWriteQuery) Stop()

Stop halts the given dependency's fetch.

func (*VaultWriteQuery) String added in v0.18.0

func (d *VaultWriteQuery) String() string

String returns the human-friendly version of this dependency.

func (*VaultWriteQuery) Type added in v0.18.0

func (d *VaultWriteQuery) Type() Type

Type returns the type of this dependency.

Jump to

Keyboard shortcuts

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