Documentation ¶
Index ¶
Constants ¶
const ( HealthAny = "any" HealthUnknown = "unknown" HealthPassing = "passing" HealthWarning = "warning" HealthCritical = "critical" )
Ripped from https://github.com/hashicorp/consul/blob/master/consul/structs/structs.go#L31
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CatalogNodes ¶
type CatalogNodes struct { DataCenter string // contains filtered or unexported fields }
func ParseCatalogNodes ¶
func ParseCatalogNodes(s ...string) (*CatalogNodes, error)
ParseCatalogNodes parses a string of the format @dc.
func (*CatalogNodes) Display ¶
func (d *CatalogNodes) Display() string
func (*CatalogNodes) Fetch ¶
func (d *CatalogNodes) Fetch(client *api.Client, options *api.QueryOptions) (interface{}, *api.QueryMeta, error)
Fetch queries the Consul API defined by the given client and returns a slice of Node objects
func (*CatalogNodes) HashCode ¶
func (d *CatalogNodes) HashCode() string
func (*CatalogNodes) Key ¶
func (d *CatalogNodes) Key() string
type CatalogService ¶
CatalogService is a catalog entry in Consul.
type CatalogServices ¶
type CatalogServices struct { Name string Tags []string DataCenter string // contains filtered or unexported fields }
CatalogServices is the representation of a requested catalog service dependency from inside a template.
func ParseCatalogServices ¶
func ParseCatalogServices(s ...string) (*CatalogServices, error)
ParseCatalogServices parses a string of the format @dc.
func (*CatalogServices) Display ¶
func (d *CatalogServices) Display() string
Display returns a string that should be displayed to the user in output (for example).
func (*CatalogServices) Fetch ¶
func (d *CatalogServices) Fetch(client *api.Client, options *api.QueryOptions) (interface{}, *api.QueryMeta, error)
Fetch queries the Consul API defined by the given client and returns a slice of CatalogService objects.
func (*CatalogServices) HashCode ¶
func (d *CatalogServices) HashCode() string
HashCode returns the hash code for this dependency.
func (*CatalogServices) Key ¶
func (d *CatalogServices) Key() string
Key returns the key given by the user in the template.
type CatalogServicesList ¶
type CatalogServicesList []*CatalogService
CatalogServicesList is a sortable slice of CatalogService structs.
func (CatalogServicesList) Len ¶
func (s CatalogServicesList) Len() int
func (CatalogServicesList) Less ¶
func (s CatalogServicesList) Less(i, j int) bool
func (CatalogServicesList) Swap ¶
func (s CatalogServicesList) Swap(i, j int)
type Dependency ¶
type Dependency interface { Fetch(*api.Client, *api.QueryOptions) (interface{}, *api.QueryMeta, error) HashCode() string Key() string Display() string }
Dependency is an interface for a dependency that Consul Template is capable of watching.
type HealthService ¶
type HealthService struct { Node string Address string ID string Name string Tags ServiceTags Port uint64 }
HealthService is a service entry in Consul
type HealthServiceList ¶
type HealthServiceList []*HealthService
HealthServiceList is a sortable slice of Service
func (HealthServiceList) Len ¶
func (s HealthServiceList) Len() int
func (HealthServiceList) Less ¶
func (s HealthServiceList) Less(i, j int) bool
func (HealthServiceList) Swap ¶
func (s HealthServiceList) Swap(i, j int)
type HealthServices ¶
type HealthServices struct { Name string Tag string DataCenter string Port uint64 Status ServiceStatusFilter // contains filtered or unexported fields }
from inside a template.
func ParseHealthServices ¶
func ParseHealthServices(s ...string) (*HealthServices, error)
ParseHealthServices processes the incoming strings to build a service dependency.
Supported arguments
ParseHealthServices("service_id") ParseHealthServices("service_id", "health_check")
Where service_id is in the format of service(.tag(@datacenter(:port))) and health_check is either "any" or "passing".
If no health_check is provided then its the same as "passing".
func (*HealthServices) Display ¶
func (d *HealthServices) Display() string
func (*HealthServices) Fetch ¶
func (d *HealthServices) Fetch(client *api.Client, options *api.QueryOptions) (interface{}, *api.QueryMeta, error)
Fetch queries the Consul API defined by the given client and returns a slice of HealthService objects.
func (*HealthServices) HashCode ¶
func (d *HealthServices) HashCode() string
func (*HealthServices) Key ¶
func (d *HealthServices) Key() string
type ServiceStatusFilter ¶
type ServiceStatusFilter []string
ServiceStatusFilter is used to specify a list of service statuses that you want filter by.
func (ServiceStatusFilter) String ¶
func (f ServiceStatusFilter) String() string
type ServiceTags ¶
type ServiceTags []string
ServiceTags is a slice of tags assigned to a Service
func (ServiceTags) Contains ¶
func (t ServiceTags) Contains(s string) bool
Contains returns true if the tags exists in the ServiceTags slice.
type StoreKey ¶
from inside a template.
func ParseStoreKey ¶
ParseStoreKey parses a string of the format a(/b(/c...))
type StoreKeyPrefix ¶
type StoreKeyPrefix struct { Prefix string DataCenter string // contains filtered or unexported fields }
StoreKeyPrefix is the representation of a requested key dependency from inside a template.
func ParseStoreKeyPrefix ¶
func ParseStoreKeyPrefix(s string) (*StoreKeyPrefix, error)
ParseStoreKeyPrefix parses a string of the format a(/b(/c...))
func (*StoreKeyPrefix) Display ¶
func (d *StoreKeyPrefix) Display() string
func (*StoreKeyPrefix) Fetch ¶
func (d *StoreKeyPrefix) Fetch(client *api.Client, options *api.QueryOptions) (interface{}, *api.QueryMeta, error)
Fetch queries the Consul API defined by the given client and returns a slice of KeyPair objects
func (*StoreKeyPrefix) HashCode ¶
func (d *StoreKeyPrefix) HashCode() string
func (*StoreKeyPrefix) Key ¶
func (d *StoreKeyPrefix) Key() string