Versions in this module Expand all Collapse all v0 v0.2.0 Dec 7, 2021 Changes in this version type CreateClientInput + TransportCustomDialer TransportDialer + type TransportDialer interface + DialContext func(ctx context.Context, network, address string) (net.Conn, error) v0.1.0 Nov 11, 2021 Changes in this version + const HealthAny + const HealthCritical + const HealthMaint + const HealthPassing + const HealthWarning + const NodeMaint + const ServiceMaint + const VaultAgentTokenSleepTime + var CatalogDatacentersQuerySleepTime = 15 * time.Second + var CatalogNodeQueryRe = regexp.MustCompile(`\A` + nodeNameRe + dcRe + `\z`) + var CatalogNodesQueryRe = regexp.MustCompile(`\A` + dcRe + nearRe + `\z`) + var CatalogServiceQueryRe = regexp.MustCompile(`\A` + tagRe + serviceNameRe + dcRe + nearRe + `\z`) + var CatalogServicesQueryRe = regexp.MustCompile(`\A` + dcRe + `\z`) + var ErrContinue = errors.New("dependency continue") + var ErrLeaseExpired = errors.New("lease expired or is not renewable") + var ErrStopped = errors.New("dependency stopped") + var FileQuerySleepTime = 2 * time.Second + var HealthServiceQueryRe = regexp.MustCompile(`\A` + tagRe + serviceNameRe + dcRe + nearRe + filterRe + `\z`) + var KVExistsQueryRe = regexp.MustCompile(`\A` + keyRe + dcRe + `\z`) + var KVGetQueryRe = regexp.MustCompile(`\A` + keyRe + dcRe + `\z`) + var KVKeysQueryRe = regexp.MustCompile(`\A` + prefixRe + dcRe + `\z`) + var KVListQueryRe = regexp.MustCompile(`\A` + prefixRe + dcRe + `\z`) + var VaultDefaultLeaseDuration = 5 * time.Minute + type BlockingQuery interface + type ByName []*dep.CatalogSnippet + func (s ByName) Len() int + func (s ByName) Less(i, j int) bool + func (s ByName) Swap(i, j int) + type ByNode []*dep.Node + func (s ByNode) Len() int + func (s ByNode) Less(i, j int) bool + func (s ByNode) Swap(i, j int) + type ByNodeThenID []*dep.HealthService + func (s ByNodeThenID) Len() int + func (s ByNodeThenID) Less(i, j int) bool + func (s ByNodeThenID) Swap(i, j int) + type ByService []*dep.CatalogNodeService + func (s ByService) Len() int + func (s ByService) Less(i, j int) bool + func (s ByService) Swap(i, j int) + type CatalogDatacentersQuery struct + func NewCatalogDatacentersQuery(ignoreFailing bool) (*CatalogDatacentersQuery, error) + func (CatalogDatacentersQuery) Consul() + func (d *CatalogDatacentersQuery) CanShare() bool + func (d *CatalogDatacentersQuery) Fetch(clients dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *CatalogDatacentersQuery) ID() string + func (d *CatalogDatacentersQuery) SetOptions(opts QueryOptions) + func (d *CatalogDatacentersQuery) Stop() + func (d *CatalogDatacentersQuery) String() string + type CatalogNodeQuery struct + func NewCatalogNodeQuery(s string) (*CatalogNodeQuery, error) + func (CatalogNodeQuery) Consul() + func (d *CatalogNodeQuery) CanShare() bool + func (d *CatalogNodeQuery) Fetch(clients dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *CatalogNodeQuery) ID() string + func (d *CatalogNodeQuery) SetOptions(opts QueryOptions) + func (d *CatalogNodeQuery) Stop() + func (d *CatalogNodeQuery) String() string + type CatalogNodesQuery struct + func NewCatalogNodesQuery(s string) (*CatalogNodesQuery, error) + func (CatalogNodesQuery) Consul() + func (d *CatalogNodesQuery) CanShare() bool + func (d *CatalogNodesQuery) Fetch(clients dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *CatalogNodesQuery) ID() string + func (d *CatalogNodesQuery) SetOptions(opts QueryOptions) + func (d *CatalogNodesQuery) Stop() + func (d *CatalogNodesQuery) String() string + type CatalogService struct + Address string + Datacenter string + ID string + Namespace string + Node string + NodeMeta map[string]string + ServiceAddress string + ServiceID string + ServiceMeta map[string]string + ServiceName string + ServicePort int + ServiceTags dep.ServiceTags + TaggedAddresses map[string]string + type CatalogServiceQuery struct + func NewCatalogServiceQuery(s string) (*CatalogServiceQuery, error) + func (CatalogServiceQuery) Consul() + func (d *CatalogServiceQuery) CanShare() bool + func (d *CatalogServiceQuery) Fetch(clients dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *CatalogServiceQuery) ID() string + func (d *CatalogServiceQuery) SetOptions(opts QueryOptions) + func (d *CatalogServiceQuery) Stop() + func (d *CatalogServiceQuery) String() string + type CatalogServicesQuery struct + func NewCatalogServicesQuery(s string) (*CatalogServicesQuery, error) + func NewCatalogServicesQueryV1(opts []string) (*CatalogServicesQuery, error) + func (CatalogServicesQuery) Consul() + func (d *CatalogServicesQuery) CanShare() bool + func (d *CatalogServicesQuery) Fetch(clients dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *CatalogServicesQuery) ID() string + func (d *CatalogServicesQuery) SetOptions(opts QueryOptions) + func (d *CatalogServicesQuery) Stop() + func (d *CatalogServicesQuery) String() string + type ClientSet struct + func NewClientSet() *ClientSet + func (c *ClientSet) Consul() *consulapi.Client + func (c *ClientSet) CreateConsulClient(i *CreateClientInput) error + func (c *ClientSet) CreateVaultClient(i *CreateClientInput) error + func (c *ClientSet) Stop() + func (c *ClientSet) Vault() *vaultapi.Client + type ConnectCAQuery struct + func NewConnectCAQuery() *ConnectCAQuery + func (ConnectCAQuery) Consul() + func (d *ConnectCAQuery) CanShare() bool + func (d *ConnectCAQuery) Fetch(clients dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *ConnectCAQuery) ID() string + func (d *ConnectCAQuery) SetOptions(opts QueryOptions) + func (d *ConnectCAQuery) Stop() + func (d *ConnectCAQuery) String() string + type ConnectLeafQuery struct + func NewConnectLeafQuery(service string) *ConnectLeafQuery + func (ConnectLeafQuery) Consul() + func (d *ConnectLeafQuery) CanShare() bool + func (d *ConnectLeafQuery) Fetch(clients dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *ConnectLeafQuery) ID() string + func (d *ConnectLeafQuery) SetOptions(opts QueryOptions) + func (d *ConnectLeafQuery) Stop() + func (d *ConnectLeafQuery) String() string + type ConsulType interface + Consul func() + type CreateClientInput struct + Address string + AuthEnabled bool + AuthPassword string + AuthUsername string + HttpClient *http.Client + Namespace string + SSLCACert string + SSLCAPath string + SSLCert string + SSLEnabled bool + SSLKey string + SSLVerify bool + ServerName string + Token string + TransportDialKeepAlive time.Duration + TransportDialTimeout time.Duration + TransportDisableKeepAlives bool + TransportIdleConnTimeout time.Duration + TransportMaxIdleConns int + TransportMaxIdleConnsPerHost int + TransportTLSHandshakeTimeout time.Duration + UnwrapToken bool + type FakeDep struct + Name string + Opts QueryOptions + func (FakeDep) Consul() + func (d *FakeDep) CanShare() bool + func (d *FakeDep) Fetch(dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *FakeDep) GetOptions() QueryOptions + func (d *FakeDep) ID() string + func (d *FakeDep) SetOptions(opts QueryOptions) + func (d *FakeDep) Stop() + func (d *FakeDep) String() string + type FakeDepBlockingQuery struct + BlockDuration time.Duration + Ctx context.Context + Data interface{} + Name string + func (FakeDepBlockingQuery) Consul() + func (d *FakeDepBlockingQuery) Fetch(dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *FakeDepBlockingQuery) ID() string + func (d *FakeDepBlockingQuery) Stop() + func (d *FakeDepBlockingQuery) String() string + type FakeDepFetchError struct + Name string + func (FakeDepFetchError) Consul() + func (d *FakeDepFetchError) Fetch(dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *FakeDepFetchError) ID() string + func (d *FakeDepFetchError) String() string + type FakeDepRetry struct + Name string + func (FakeDepRetry) Consul() + func (d *FakeDepRetry) Fetch(dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *FakeDepRetry) ID() string + func (d *FakeDepRetry) String() string + type FakeDepSameIndex struct + func (FakeDepSameIndex) Consul() + func (d *FakeDepSameIndex) Fetch(dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *FakeDepSameIndex) ID() string + func (d *FakeDepSameIndex) String() string + type FakeDepStale struct + Name string + func (FakeDepStale) Consul() + func (d *FakeDepStale) Fetch(clients dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *FakeDepStale) ID() string + func (d *FakeDepStale) String() string + type FakeListDep struct + Data []string + Name string + func (FakeListDep) Consul() + func (d *FakeListDep) Fetch(dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *FakeListDep) ID() string + func (d *FakeListDep) String() string + type FileQuery struct + func NewFileQuery(s string) (*FileQuery, error) + func (d *FileQuery) CanShare() bool + func (d *FileQuery) Fetch(clients dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *FileQuery) ID() string + func (d *FileQuery) SetOptions(opts QueryOptions) + func (d *FileQuery) Stop() + func (d *FileQuery) String() string + type HealthServiceQuery struct + func NewHealthConnectQuery(s string) (*HealthServiceQuery, error) + func NewHealthConnectQueryV1(s string, opts []string) (*HealthServiceQuery, error) + func NewHealthServiceQuery(s string) (*HealthServiceQuery, error) + func NewHealthServiceQueryV1(s string, opts []string) (*HealthServiceQuery, error) + func (HealthServiceQuery) Consul() + func (d *HealthServiceQuery) CanShare() bool + func (d *HealthServiceQuery) Fetch(clients dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *HealthServiceQuery) ID() string + func (d *HealthServiceQuery) SetOptions(opts QueryOptions) + func (d *HealthServiceQuery) Stop() + func (d *HealthServiceQuery) String() string + type KVExistsGetQuery struct + func NewKVExistsGetQueryV1(key string, opts []string) (*KVExistsGetQuery, error) + func (KVExistsGetQuery) Consul() + func (d *KVExistsGetQuery) CanShare() bool + func (d *KVExistsGetQuery) Fetch(clients dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *KVExistsGetQuery) ID() string + func (d *KVExistsGetQuery) SetOptions(opts QueryOptions) + func (d *KVExistsGetQuery) Stop() + func (d *KVExistsGetQuery) String() string + type KVExistsQuery struct + func NewKVExistsQuery(s string) (*KVExistsQuery, error) + func NewKVExistsQueryV1(key string, opts []string) (*KVExistsQuery, error) + func (KVExistsQuery) Consul() + func (d *KVExistsQuery) CanShare() bool + func (d *KVExistsQuery) Fetch(clients dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *KVExistsQuery) ID() string + func (d *KVExistsQuery) SetOptions(opts QueryOptions) + func (d *KVExistsQuery) Stop() + func (d *KVExistsQuery) String() string + type KVGetQuery struct + func NewKVGetQuery(s string) (*KVGetQuery, error) + func NewKVGetQueryV1(key string, opts []string) (*KVGetQuery, error) + func (KVGetQuery) Consul() + func (d *KVGetQuery) CanShare() bool + func (d *KVGetQuery) Fetch(clients dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *KVGetQuery) ID() string + func (d *KVGetQuery) SetOptions(opts QueryOptions) + func (d *KVGetQuery) Stop() + func (d *KVGetQuery) String() string + type KVKeysQuery struct + func NewKVKeysQuery(s string) (*KVKeysQuery, error) + func (KVKeysQuery) Consul() + func (d *KVKeysQuery) CanShare() bool + func (d *KVKeysQuery) Fetch(clients dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *KVKeysQuery) ID() string + func (d *KVKeysQuery) SetOptions(opts QueryOptions) + func (d *KVKeysQuery) Stop() + func (d *KVKeysQuery) String() string + type KVListQuery struct + func NewKVListQuery(s string) (*KVListQuery, error) + func NewKVListQueryV1(prefix string, opts []string) (*KVListQuery, error) + func (KVListQuery) Consul() + func (d *KVListQuery) CanShare() bool + func (d *KVListQuery) Fetch(clients dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *KVListQuery) ID() string + func (d *KVListQuery) SetOptions(opts QueryOptions) + func (d *KVListQuery) Stop() + func (d *KVListQuery) String() string + type QueryOptions struct + AllowStale bool + Datacenter string + DefaultLease time.Duration + Filter string + Namespace string + Near string + RequireConsistent bool + VaultGrace time.Duration + WaitIndex uint64 + WaitTime time.Duration + func (q *QueryOptions) Merge(o *QueryOptions) *QueryOptions + func (q *QueryOptions) SetContext(ctx context.Context) QueryOptions + func (q *QueryOptions) String() string + func (q *QueryOptions) ToConsulOpts() *consulapi.QueryOptions + type QueryOptionsSetter interface + SetOptions func(QueryOptions) + type ResponseMetadata = dep.ResponseMetadata + type VaultAgentTokenQuery struct + func NewVaultAgentTokenQuery(path string) (*VaultAgentTokenQuery, error) + func (VaultAgentTokenQuery) Vault() + func (d *VaultAgentTokenQuery) CanShare() bool + func (d *VaultAgentTokenQuery) Fetch(clients dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *VaultAgentTokenQuery) ID() string + func (d *VaultAgentTokenQuery) SetOptions(opts QueryOptions) + func (d *VaultAgentTokenQuery) Stop() + func (d *VaultAgentTokenQuery) String() string + type VaultListQuery struct + func NewVaultListQuery(s string) (*VaultListQuery, error) + func (VaultListQuery) Vault() + func (d *VaultListQuery) CanShare() bool + func (d *VaultListQuery) Fetch(clients dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *VaultListQuery) ID() string + func (d *VaultListQuery) SetOptions(opts QueryOptions) + func (d *VaultListQuery) Stop() + func (d *VaultListQuery) String() string + type VaultReadQuery struct + func NewVaultReadQuery(s string) (*VaultReadQuery, error) + func (VaultReadQuery) Vault() + func (d *VaultReadQuery) CanShare() bool + func (d *VaultReadQuery) Fetch(clients dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *VaultReadQuery) ID() string + func (d *VaultReadQuery) SetOptions(opts QueryOptions) + func (d *VaultReadQuery) Stop() + func (d *VaultReadQuery) String() string + type VaultTokenQuery struct + func NewVaultTokenQuery(token string) (*VaultTokenQuery, error) + func (VaultTokenQuery) Vault() + func (d *VaultTokenQuery) CanShare() bool + func (d *VaultTokenQuery) Fetch(clients dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *VaultTokenQuery) ID() string + func (d *VaultTokenQuery) SetOptions(opts QueryOptions) + func (d *VaultTokenQuery) Stop() + func (d *VaultTokenQuery) String() string + type VaultType interface + Vault func() + type VaultWriteQuery struct + func NewVaultWriteQuery(s string, d map[string]interface{}) (*VaultWriteQuery, error) + func (VaultWriteQuery) Vault() + func (d *VaultWriteQuery) CanShare() bool + func (d *VaultWriteQuery) Fetch(clients dep.Clients) (interface{}, *dep.ResponseMetadata, error) + func (d *VaultWriteQuery) ID() string + func (d *VaultWriteQuery) SetOptions(opts QueryOptions) + func (d *VaultWriteQuery) Stop() + func (d *VaultWriteQuery) String() string