Documentation
¶
Index ¶
Constants ¶
const ServiceBackendWeight uint = 10
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EtcdOptions ¶
type EtcdOptions struct { Scheme string `long:"etcd-scheme" value-name:"http|https" default:"http" description:"Set default scheme for etcd:// URLs"` Hosts []string `long:"etcd-host" value-name:"HOST:PORT" description:"Include hosts"` Prefix string `long:"etcd-prefix" value-name:"/PATH" default:"/clusterf" description:"Namespace all keys under given path"` TTL time.Duration `long:"etcd-ttl" value-name:"DURATION" default:"10s" description:"Write values with given TTL, and refresh at half of that"` // contains filtered or unexported fields }
func (EtcdOptions) Open ¶
func (options EtcdOptions) Open() (*EtcdSource, error)
func (EtcdOptions) OpenURL ¶
func (options EtcdOptions) OpenURL(url *url.URL) (*EtcdSource, error)
func (EtcdOptions) String ¶
func (options EtcdOptions) String() string
type EtcdSource ¶
type EtcdSource struct {
// contains filtered or unexported fields
}
func (*EtcdSource) Init ¶
func (etcd *EtcdSource) Init() error
* Initialize state in etcd. * * Creates the top-level config directory if it does not exist, and initialize to follow it
func (*EtcdSource) Scan ¶
func (etcd *EtcdSource) Scan() ([]Node, error)
* Synchronize current state in etcd. * * Does a recursive get on the complete /clusterf tree in etcd, and builds the services state from it. * * Stores the current etcd-index from the snapshot in .syncIndex, so that .Sync() can be used to continue updating any changes.
func (*EtcdSource) String ¶
func (etcd *EtcdSource) String() string
func (*EtcdSource) Sync ¶
func (etcd *EtcdSource) Sync(syncChan chan Node) error
* Watch for changed Nodes in etcd. * * Sends any changes on the returned channel. Closes the channel on errors.
type FileOptions ¶
type FileOptions struct {
Path string
}
func (FileOptions) Open ¶
func (options FileOptions) Open() (*FileSource, error)
type FileSource ¶
type FileSource struct {
// contains filtered or unexported fields
}
func (*FileSource) Scan ¶
func (fs *FileSource) Scan() (nodes []Node, err error)
Recursively any Config's under given path
func (*FileSource) String ¶
func (fs *FileSource) String() string
type Node ¶
type Node struct { /* Identity */ Source Source // clusterf-relative path, so with any prefix and leading / stripped Path string /* Type/Value */ IsDir bool // json-encoded; empty if removed Value string Remove bool }
Low-level config model, used to load files from local and etcd
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Read and merge Configs from multiple Sources
type ReaderOptions ¶
type ReaderOptions struct { SourceOptions SourceURLs []string `` /* 133-byte string literal not displayed */ FilterRoutes string `long:"filter-routes" value-name:"URL-PREFIX" description:"Only apply routes from matching --config-source"` }
func (ReaderOptions) Reader ¶
func (options ReaderOptions) Reader() (*Reader, error)
Return a new Reader with the given config URLs opened
type Route ¶
type Route struct { Meta `json:"-"` // IPv4/IPv6 prefix to match // empty for default match Prefix string `json:",omitempty"` // Override backend IPv4/IPv6 address for ipvs Gateway string `json:",omitempty"` // Configure IPVS fwd-method for destination: // droute tunnel masq // Filter out backend if set to empty string. IPVSMethod string `json:",omitempty"` }
type Service ¶
type Service struct { Meta `json:"-"` Frontend *ServiceFrontend Backends map[string]ServiceBackend }
type ServiceBackend ¶
type ServiceFrontend ¶
type Source ¶
type Source interface { // uniquely identifying String() string }
A single Config may contain Nodes from different Sources
type SourceOptions ¶
type SourceOptions struct {
Etcd EtcdOptions `group:"Config etcd://"`
}
type WriterOptions ¶
type WriterOptions struct { SourceOptions SourceURL string `long:"config-source" value-name:"(file|etcd|etcd+http|etcd+https)://[<host>]/<path>" description:"Write to given source"` }
func (WriterOptions) Writer ¶
func (options WriterOptions) Writer() (*Writer, error)