Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dependency ¶
type Dependency interface {
Fetch(*api.Client, *api.QueryOptions) (interface{}, *api.QueryMeta, error)
HashCode() string
Key() string
Display() string
}
Dependency is an interface
type FileDependency ¶
type FileDependency struct {
// contains filtered or unexported fields
}
func ParseFileDependency ¶
func ParseFileDependency(s string) (*FileDependency, error)
func (*FileDependency) Display ¶
func (d *FileDependency) Display() string
func (*FileDependency) Fetch ¶
func (d *FileDependency) Fetch(client *api.Client, options *api.QueryOptions) (interface{}, *api.QueryMeta, error)
func (*FileDependency) HashCode ¶
func (d *FileDependency) HashCode() string
func (*FileDependency) Key ¶
func (d *FileDependency) Key() string
type KeyDependency ¶
type KeyDependency struct {
Path string
DataCenter string
// contains filtered or unexported fields
}
KeyDependency is the representation of a requested key dependency from inside a template.
func ParseKeyDependency ¶
func ParseKeyDependency(s string) (*KeyDependency, error)
ParseKeyDependency parses a string of the format a(/b(/c...))
func (*KeyDependency) Display ¶
func (d *KeyDependency) Display() string
func (*KeyDependency) Fetch ¶
func (d *KeyDependency) Fetch(client *api.Client, options *api.QueryOptions) (interface{}, *api.QueryMeta, error)
Fetch queries the Consul API defined by the given client and returns string of the value to Path.
func (*KeyDependency) HashCode ¶
func (d *KeyDependency) HashCode() string
func (*KeyDependency) Key ¶
func (d *KeyDependency) Key() string
type KeyPrefixDependency ¶
type KeyPrefixDependency struct {
Prefix string
DataCenter string
// contains filtered or unexported fields
}
KeyPrefixDependency is the representation of a requested key dependency from inside a template.
func ParseKeyPrefixDependency ¶
func ParseKeyPrefixDependency(s string) (*KeyPrefixDependency, error)
ParseKeyDependency parses a string of the format a(/b(/c...))
func (*KeyPrefixDependency) Display ¶
func (d *KeyPrefixDependency) Display() string
func (*KeyPrefixDependency) Fetch ¶
func (d *KeyPrefixDependency) 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 (*KeyPrefixDependency) HashCode ¶
func (d *KeyPrefixDependency) HashCode() string
func (*KeyPrefixDependency) Key ¶
func (d *KeyPrefixDependency) Key() string
type ServiceDependency ¶
type ServiceDependency struct {
Name string
Tag string
DataCenter string
Port uint64
// contains filtered or unexported fields
}
ServiceDependency is the representation of a requested service dependency from inside a template.
func ParseServiceDependency ¶
func ParseServiceDependency(s string) (*ServiceDependency, error)
ParseServiceDependency parses a string of the format service(.tag(@datacenter(:port)))
func (*ServiceDependency) Display ¶
func (d *ServiceDependency) Display() string
func (*ServiceDependency) Fetch ¶
func (d *ServiceDependency) 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 Service objects.
func (*ServiceDependency) HashCode ¶
func (d *ServiceDependency) HashCode() string
func (*ServiceDependency) Key ¶
func (d *ServiceDependency) Key() string
type ServiceList ¶
type ServiceList []*Service
ServiceList is a sortable slice of Service
func (ServiceList) Len ¶
func (s ServiceList) Len() int
func (ServiceList) Less ¶
func (s ServiceList) Less(i, j int) bool
func (ServiceList) Swap ¶
func (s ServiceList) Swap(i, j int)
type Wait ¶
type Wait struct {
// Min and Max are the minimum and maximum time, respectively, to wait for
// data changes before rendering a new template to disk.
Min, Max time.Duration
}
Wait is the Min/Max duration used by the Watcher
type WatchData ¶
type WatchData struct {
Dependency Dependency
Data interface{}
// contains filtered or unexported fields
}
func NewWatchData ¶
func NewWatchData(dependency Dependency) (*WatchData, error)
type Watcher ¶
type Watcher struct {
// DataCh is the chan where new WatchData will be published
DataCh chan *WatchData
// ErrCh is the chan where any errors will be published
ErrCh chan error
// FinishCh is the chan where the watcher reports it is "done"
FinishCh chan struct{}
// contains filtered or unexported fields
}
func NewWatcher ¶
func NewWatcher(client *api.Client, dependencies []Dependency) (*Watcher, error)