config

package
v0.0.0-...-bc96e6b Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2015 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string

* Events when config changes

const (
	// Initialize configuration into a consistent state from Scan()
	NewConfig Action = "new"

	// Changes to active configuration from Sync()
	SetConfig Action = "set"
	DelConfig Action = "del"
)

type Config

type Config interface {
	// Unique path for this config
	Path() string

	// JSON-encodeable value
	Value() interface{}
}

type ConfigRoute

type ConfigRoute struct {
	RouteName string

	Route Route
}

func (ConfigRoute) Path

func (self ConfigRoute) Path() string

func (ConfigRoute) Value

func (self ConfigRoute) Value() interface{}

type ConfigService

type ConfigService struct {
	ServiceName string
}

Used when a new service directory is created or destroyed. May not necessarily be delivered when a new service is created; you can expect to directly get a ConfigService* event for a new service May be delievered with an empty ServiceName:"" if *all* services are to be deleted

func (ConfigService) Path

func (self ConfigService) Path() string

func (ConfigService) Value

func (self ConfigService) Value() interface{}

type ConfigServiceBackend

type ConfigServiceBackend struct {
	ServiceName string
	BackendName string

	Backend ServiceBackend
}

May be delivered with an empty BackendName:"" if *all* service backends are to be deleted

func (ConfigServiceBackend) Path

func (self ConfigServiceBackend) Path() string

func (ConfigServiceBackend) Value

func (self ConfigServiceBackend) Value() interface{}

type ConfigServiceFrontend

type ConfigServiceFrontend struct {
	ServiceName string

	Frontend ServiceFrontend
}

func (ConfigServiceFrontend) Path

func (self ConfigServiceFrontend) Path() string

func (ConfigServiceFrontend) Value

func (self ConfigServiceFrontend) Value() interface{}

type Etcd

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

func (*Etcd) Init

func (self *Etcd) Init() error

* Initialize state in etcd

func (*Etcd) Publish

func (self *Etcd) Publish(config Config) error

Publish a config into etcd

func (*Etcd) Retract

func (self *Etcd) Retract(config Config) error

Retract a config from etcd

func (*Etcd) Scan

func (self *Etcd) Scan() ([]Config, 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 (*Etcd) String

func (self *Etcd) String() string

func (*Etcd) Sync

func (self *Etcd) Sync() chan Event

* Watch for changes in etcd * * Sends any changes on the returned channel.

type EtcdConfig

type EtcdConfig struct {
	Machines string
	Prefix   string
}

func (EtcdConfig) Open

func (self EtcdConfig) Open() (*Etcd, error)

* Open etcd session

type Event

type Event struct {
	Action Action
	Config Config
}

A Config has changed

type Files

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

func (*Files) Scan

func (self *Files) Scan() (configs []Config, err error)

Recursively any Config's under given path

func (*Files) String

func (self *Files) String() string

type FilesConfig

type FilesConfig struct {
	Path string
}

func (FilesConfig) Open

func (self FilesConfig) Open() (*Files, error)

type Node

type Node struct {
	// clusterf-relative path, so with any prefix stripped
	Path  string
	IsDir bool

	// json-encoded
	Value string
}

type Route

type Route struct {
	// IPv4 prefix to match
	// empty for default match
	Prefix4 string

	// Override backend IPv4 address for ipvs
	Gateway4 string

	// Configure IPVS fwd-method to use for destination
	//  droute tunnel masq
	// Filter out backend if set to
	//  filter
	IpvsMethod string
}

type ServiceBackend

type ServiceBackend struct {
	IPv4 string `json:"ipv4,omitempty"`
	IPv6 string `json:"ipv6,omitempty"`
	TCP  uint16 `json:"tcp,omitempty"`
	UDP  uint16 `json:"udp,omitempty"`

	Weight uint `json:"weight,omitempty"` // default: 10
}

type ServiceFrontend

type ServiceFrontend struct {
	IPv4 string `json:"ipv4,omitempty"`
	IPv6 string `json:"ipv6,omitempty"`
	TCP  uint16 `json:"tcp,omitempty"`
	UDP  uint16 `json:"udp,omitempty"`
}

Jump to

Keyboard shortcuts

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