Documentation ¶
Index ¶
- Constants
- type App
- type AppConfig
- func (s *AppConfig) AddPort(port, portType string)
- func (s *AppConfig) ClearPorts()
- func (s *AppConfig) ContainerName() string
- func (s *AppConfig) Env() map[string]string
- func (s *AppConfig) EnvGet(key string) string
- func (s *AppConfig) EnvSet(key, value string)
- func (s *AppConfig) GetCPUShares(pool string) string
- func (s *AppConfig) GetMemory(pool string) string
- func (s *AppConfig) GetProcesses(pool string) int
- func (s *AppConfig) ID() int64
- func (s *AppConfig) Name() string
- func (s *AppConfig) Ports() map[string]string
- func (s *AppConfig) RuntimePools() []string
- func (s *AppConfig) SetCPUShares(pool string, cpu string)
- func (s *AppConfig) SetMemory(pool string, mem string)
- func (s *AppConfig) SetProcesses(pool string, count int)
- func (s *AppConfig) SetVersion(version string)
- func (s *AppConfig) SetVersionID(versionID string)
- func (s *AppConfig) Version() string
- func (s *AppConfig) VersionID() string
- type Backend
- type ConfigChange
- type HostInfo
- type MemoryBackend
- func (r *MemoryBackend) AddMember(key, value string) (int, error)
- func (r *MemoryBackend) AppExists(app, env string) (bool, error)
- func (r *MemoryBackend) AssignApp(app, env, pool string) (bool, error)
- func (r *MemoryBackend) CreateApp(app, env string) (bool, error)
- func (r *MemoryBackend) CreatePool(env, pool string) (bool, error)
- func (r *MemoryBackend) Delete(key string) (int, error)
- func (r *MemoryBackend) DeleteApp(svcCfg App, env string) (bool, error)
- func (r *MemoryBackend) DeleteHost(env, pool string, host HostInfo) error
- func (r *MemoryBackend) DeleteMulti(key string, fields ...string) (int, error)
- func (r *MemoryBackend) DeletePool(env, pool string) (bool, error)
- func (r *MemoryBackend) Expire(key string, ttl uint64) (int, error)
- func (r *MemoryBackend) Get(key, field string) (string, error)
- func (r *MemoryBackend) GetAll(key string) (map[string]string, error)
- func (r *MemoryBackend) GetApp(app, env string) (App, error)
- func (r *MemoryBackend) Keys(key string) ([]string, error)
- func (r *MemoryBackend) ListApps(env string) ([]App, error)
- func (r *MemoryBackend) ListAssignments(env, pool string) ([]string, error)
- func (r *MemoryBackend) ListEnvs() ([]string, error)
- func (r *MemoryBackend) ListHosts(env, pool string) ([]HostInfo, error)
- func (r *MemoryBackend) ListPools(env string) ([]string, error)
- func (r *MemoryBackend) Members(key string) ([]string, error)
- func (r *MemoryBackend) Notify(key, value string) (int, error)
- func (r *MemoryBackend) RemoveMember(key, value string) (int, error)
- func (r *MemoryBackend) Set(key, field string, value string) (string, error)
- func (r *MemoryBackend) SetMulti(key string, values map[string]string) (string, error)
- func (r *MemoryBackend) Subscribe(key string) chan string
- func (r *MemoryBackend) TTL(key string) (int, error)
- func (r *MemoryBackend) UnassignApp(app, env, pool string) (bool, error)
- func (r *MemoryBackend) UpdateApp(svcCfg App, env string) (bool, error)
- func (r *MemoryBackend) UpdateHost(env, pool string, host HostInfo) error
- type RedisBackend
- func (r *RedisBackend) AddMember(key, value string) (int, error)
- func (r *RedisBackend) AppExists(app, env string) (bool, error)
- func (r *RedisBackend) AssignApp(app, env, pool string) (bool, error)
- func (r *RedisBackend) CreateApp(app, env string) (bool, error)
- func (r *RedisBackend) CreatePool(env, pool string) (bool, error)
- func (r *RedisBackend) Delete(key string) (int, error)
- func (r *RedisBackend) DeleteApp(svcCfg App, env string) (bool, error)
- func (r *RedisBackend) DeleteHost(env, pool string, host HostInfo) error
- func (r *RedisBackend) DeleteMulti(key string, fields ...string) (int, error)
- func (r *RedisBackend) DeletePool(env, pool string) (bool, error)
- func (r *RedisBackend) Expire(key string, ttl uint64) (int, error)
- func (r *RedisBackend) GcVMap(key string, vmap *utils.VersionedMap) error
- func (r *RedisBackend) Get(key, field string) (string, error)
- func (r *RedisBackend) GetAll(key string) (map[string]string, error)
- func (r *RedisBackend) GetApp(app, env string) (App, error)
- func (r *RedisBackend) Keys(key string) ([]string, error)
- func (r *RedisBackend) ListApps(env string) ([]App, error)
- func (r *RedisBackend) ListAssignments(env, pool string) ([]string, error)
- func (r *RedisBackend) ListEnvs() ([]string, error)
- func (r *RedisBackend) ListHosts(env, pool string) ([]HostInfo, error)
- func (r *RedisBackend) ListPools(env string) ([]string, error)
- func (r *RedisBackend) LoadVMap(key string, dest *utils.VersionedMap) error
- func (r *RedisBackend) Members(key string) ([]string, error)
- func (r *RedisBackend) Notify(key, value string) (int, error)
- func (r *RedisBackend) RemoveMember(key, value string) (int, error)
- func (r *RedisBackend) SaveVMap(key string, vmap *utils.VersionedMap) error
- func (r *RedisBackend) Set(key, field string, value string) (string, error)
- func (r *RedisBackend) SetMulti(key string, values map[string]string) (string, error)
- func (r *RedisBackend) Subscribe(key string) chan string
- func (r *RedisBackend) TTL(key string) (int, error)
- func (r *RedisBackend) UnassignApp(app, env, pool string) (bool, error)
- func (r *RedisBackend) UpdateApp(cfg App, env string) (bool, error)
- func (r *RedisBackend) UpdateHost(env, pool string, host HostInfo) error
- type ServiceRegistration
- type Store
- func (s *Store) AppExists(app, env string) (bool, error)
- func (s *Store) AssignApp(app, env, pool string) (bool, error)
- func (s *Store) CheckForChangesNow()
- func (s *Store) CreateApp(app, env string) (bool, error)
- func (s *Store) CreatePool(name, env string) (bool, error)
- func (s *Store) DeleteApp(app, env string) (bool, error)
- func (s *Store) DeleteHost(env, pool string, host HostInfo) error
- func (s *Store) DeletePool(pool, env string) (bool, error)
- func (s *Store) EnvFor(container *docker.Container) map[string]string
- func (s *Store) GetApp(app, env string) (App, error)
- func (s *Store) GetServiceRegistration(env, pool, hostIP string, container *docker.Container) (*ServiceRegistration, error)
- func (s *Store) IsRegistered(env, pool, hostIP string, container *docker.Container) (bool, error)
- func (s *Store) ListApps(env string) ([]App, error)
- func (s *Store) ListAssignedPools(env, app string) ([]string, error)
- func (s *Store) ListAssignments(env, pool string) ([]string, error)
- func (s *Store) ListEnvs() ([]string, error)
- func (s *Store) ListHosts(env, pool string) ([]HostInfo, error)
- func (s *Store) ListPools(env string) ([]string, error)
- func (s *Store) ListRegistrations(env string) ([]ServiceRegistration, error)
- func (s *Store) NotifyEnvChanged(env string) error
- func (s *Store) NotifyRestart(app, env string) error
- func (s *Store) PoolExists(env, pool string) (bool, error)
- func (s *Store) RegisterService(env, pool, hostIP string, container *docker.Container) (*ServiceRegistration, error)
- func (s *Store) UnRegisterService(env, pool, hostIP string, container *docker.Container) (*ServiceRegistration, error)
- func (s *Store) UnassignApp(app, env, pool string) (bool, error)
- func (s *Store) UpdateApp(svcCfg App, env string) (bool, error)
- func (s *Store) UpdateHost(env, pool string, host HostInfo) error
- func (s *Store) Watch(env string, stop chan struct{}) chan *ConfigChange
- type Value
Constants ¶
View Source
const (
DefaultTTL = 60
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶ added in v0.6.0
type App interface { Name() string Env() map[string]string EnvSet(key, value string) EnvGet(key string) string Version() string SetVersion(version string) VersionID() string SetVersionID(versionID string) Ports() map[string]string ClearPorts() AddPort(port, portType string) ID() int64 ContainerName() string SetProcesses(pool string, count int) GetProcesses(pool string) int RuntimePools() []string SetMemory(pool string, mem string) GetMemory(pool string) string }
Interface to wrap AppConfig, so that it can be swapped out with a different Backend. This should be temporary as many of these methods won't be useful.
func NewAppConfig ¶
type AppConfig ¶
type AppConfig struct {
// contains filtered or unexported fields
}
func (*AppConfig) ClearPorts ¶
func (s *AppConfig) ClearPorts()
func (*AppConfig) ContainerName ¶
func (*AppConfig) Env ¶
Env returns a map representing the runtime environment for the container. Changes to this map have no effect.
func (*AppConfig) GetCPUShares ¶
func (*AppConfig) GetProcesses ¶
func (*AppConfig) RuntimePools ¶
func (*AppConfig) SetCPUShares ¶
func (*AppConfig) SetProcesses ¶
func (*AppConfig) SetVersion ¶
func (*AppConfig) SetVersionID ¶
type Backend ¶
type Backend interface { // Apps AppExists(app, env string) (bool, error) CreateApp(app, env string) (bool, error) ListApps(env string) ([]App, error) GetApp(app, env string) (App, error) UpdateApp(svcCfg App, env string) (bool, error) DeleteApp(svcCfg App, env string) (bool, error) // Pools AssignApp(app, env, pool string) (bool, error) UnassignApp(app, env, pool string) (bool, error) ListAssignments(env, pool string) ([]string, error) CreatePool(env, pool string) (bool, error) DeletePool(env, pool string) (bool, error) ListPools(env string) ([]string, error) // Envs ListEnvs() ([]string, error) // Host UpdateHost(env, pool string, host HostInfo) error ListHosts(env, pool string) ([]HostInfo, error) DeleteHost(env, pool string, host HostInfo) error //Pub/Sub Subscribe(key string) chan string Notify(key, value string) (int, error) // TODO: still merging these backends // these are brought in from the RegistryBackend // Keys Keys(key string) ([]string, error) Delete(key string) (int, error) Expire(key string, ttl uint64) (int, error) TTL(key string) (int, error) // Maps Set(key, field string, value string) (string, error) Get(key, field string) (string, error) // contains filtered or unexported methods }
type ConfigChange ¶
type MemoryBackend ¶
type MemoryBackend struct { AppExistsFunc func(app, env string) (bool, error) CreateAppFunc func(app, env string) (bool, error) GetAppFunc func(app, env string) (App, error) UpdateAppFunc func(svcCfg App, env string) (bool, error) DeleteAppFunc func(svcCfg App, env string) (bool, error) ListAppFunc func(env string) ([]AppConfig, error) AssignAppFunc func(app, env, pool string) (bool, error) UnassignAppFunc func(app, env, pool string) (bool, error) ListAssignmentsFunc func(env, pool string) ([]string, error) CreatePoolFunc func(env, pool string) (bool, error) DeletePoolFunc func(env, pool string) (bool, error) ListPoolsFunc func(env string) ([]string, error) ListEnvsFunc func() ([]string, error) ListHostsFunc func(env, pool string) ([]HostInfo, error) MembersFunc func(key string) ([]string, error) KeysFunc func(key string) ([]string, error) AddMemberFunc func(key, value string) (int, error) RemoveMemberFunc func(key, value string) (int, error) NotifyFunc func(key, value string) (int, error) SetMultiFunc func(key string, values map[string]string) (string, error) // contains filtered or unexported fields }
func NewMemoryBackend ¶
func NewMemoryBackend() *MemoryBackend
func (*MemoryBackend) AssignApp ¶
func (r *MemoryBackend) AssignApp(app, env, pool string) (bool, error)
func (*MemoryBackend) CreatePool ¶
func (r *MemoryBackend) CreatePool(env, pool string) (bool, error)
func (*MemoryBackend) DeleteApp ¶
func (r *MemoryBackend) DeleteApp(svcCfg App, env string) (bool, error)
func (*MemoryBackend) DeleteHost ¶
func (r *MemoryBackend) DeleteHost(env, pool string, host HostInfo) error
func (*MemoryBackend) DeleteMulti ¶
func (r *MemoryBackend) DeleteMulti(key string, fields ...string) (int, error)
func (*MemoryBackend) DeletePool ¶
func (r *MemoryBackend) DeletePool(env, pool string) (bool, error)
func (*MemoryBackend) GetAll ¶
func (r *MemoryBackend) GetAll(key string) (map[string]string, error)
func (*MemoryBackend) ListAssignments ¶
func (r *MemoryBackend) ListAssignments(env, pool string) ([]string, error)
func (*MemoryBackend) ListEnvs ¶
func (r *MemoryBackend) ListEnvs() ([]string, error)
func (*MemoryBackend) ListHosts ¶
func (r *MemoryBackend) ListHosts(env, pool string) ([]HostInfo, error)
func (*MemoryBackend) RemoveMember ¶
func (r *MemoryBackend) RemoveMember(key, value string) (int, error)
func (*MemoryBackend) Set ¶
func (r *MemoryBackend) Set(key, field string, value string) (string, error)
func (*MemoryBackend) Subscribe ¶
func (r *MemoryBackend) Subscribe(key string) chan string
func (*MemoryBackend) UnassignApp ¶
func (r *MemoryBackend) UnassignApp(app, env, pool string) (bool, error)
func (*MemoryBackend) UpdateApp ¶
func (r *MemoryBackend) UpdateApp(svcCfg App, env string) (bool, error)
func (*MemoryBackend) UpdateHost ¶
func (r *MemoryBackend) UpdateHost(env, pool string, host HostInfo) error
type RedisBackend ¶
type RedisBackend struct { RedisHost string // contains filtered or unexported fields }
func (*RedisBackend) AssignApp ¶
func (r *RedisBackend) AssignApp(app, env, pool string) (bool, error)
func (*RedisBackend) CreatePool ¶
func (r *RedisBackend) CreatePool(env, pool string) (bool, error)
func (*RedisBackend) DeleteApp ¶
func (r *RedisBackend) DeleteApp(svcCfg App, env string) (bool, error)
func (*RedisBackend) DeleteHost ¶
func (r *RedisBackend) DeleteHost(env, pool string, host HostInfo) error
func (*RedisBackend) DeleteMulti ¶
func (r *RedisBackend) DeleteMulti(key string, fields ...string) (int, error)
func (*RedisBackend) DeletePool ¶
func (r *RedisBackend) DeletePool(env, pool string) (bool, error)
func (*RedisBackend) GcVMap ¶
func (r *RedisBackend) GcVMap(key string, vmap *utils.VersionedMap) error
func (*RedisBackend) ListAssignments ¶
func (r *RedisBackend) ListAssignments(env, pool string) ([]string, error)
func (*RedisBackend) ListEnvs ¶
func (r *RedisBackend) ListEnvs() ([]string, error)
func (*RedisBackend) ListHosts ¶
func (r *RedisBackend) ListHosts(env, pool string) ([]HostInfo, error)
func (*RedisBackend) LoadVMap ¶
func (r *RedisBackend) LoadVMap(key string, dest *utils.VersionedMap) error
func (*RedisBackend) RemoveMember ¶
func (r *RedisBackend) RemoveMember(key, value string) (int, error)
func (*RedisBackend) SaveVMap ¶
func (r *RedisBackend) SaveVMap(key string, vmap *utils.VersionedMap) error
func (*RedisBackend) Set ¶
func (r *RedisBackend) Set(key, field string, value string) (string, error)
func (*RedisBackend) Subscribe ¶
func (r *RedisBackend) Subscribe(key string) chan string
func (*RedisBackend) UnassignApp ¶
func (r *RedisBackend) UnassignApp(app, env, pool string) (bool, error)
func (*RedisBackend) UpdateApp ¶
func (r *RedisBackend) UpdateApp(cfg App, env string) (bool, error)
func (*RedisBackend) UpdateHost ¶
func (r *RedisBackend) UpdateHost(env, pool string, host HostInfo) error
type ServiceRegistration ¶ added in v0.6.0
type ServiceRegistration struct { Name string `json:"NAME,omitempty"` ExternalIP string `json:"EXTERNAL_IP,omitempty"` ExternalPort string `json:"EXTERNAL_PORT,omitempty"` InternalIP string `json:"INTERNAL_IP,omitempty"` InternalPort string `json:"INTERNAL_PORT,omitempty"` ContainerID string `json:"CONTAINER_ID"` ContainerName string `json:"CONTAINER_NAME"` Image string `json:"IMAGE,omitempty"` ImageId string `json:"IMAGE_ID,omitempty"` StartedAt time.Time `json:"STARTED_AT"` Expires time.Time `json:"-"` Path string `json:"-"` VirtualHosts []string `json:"VIRTUAL_HOSTS"` Port string `json:"PORT"` ErrorPages map[string]string `json:"ERROR_PAGES,omitempty"` }
func (*ServiceRegistration) Equals ¶ added in v0.6.0
func (s *ServiceRegistration) Equals(other ServiceRegistration) bool
func (*ServiceRegistration) ExternalAddr ¶ added in v0.6.0
func (s *ServiceRegistration) ExternalAddr() string
func (*ServiceRegistration) InternalAddr ¶ added in v0.6.0
func (s *ServiceRegistration) InternalAddr() string
type Store ¶
func (*Store) CheckForChangesNow ¶
func (s *Store) CheckForChangesNow()
func (*Store) GetServiceRegistration ¶ added in v0.6.0
func (s *Store) GetServiceRegistration(env, pool, hostIP string, container *docker.Container) (*ServiceRegistration, error)
func (*Store) IsRegistered ¶ added in v0.6.0
func (*Store) ListAssignedPools ¶
func (*Store) ListRegistrations ¶ added in v0.6.0
func (s *Store) ListRegistrations(env string) ([]ServiceRegistration, error)
TODO: get all ServiceRegistrations
func (*Store) NotifyEnvChanged ¶
func (*Store) NotifyRestart ¶
func (*Store) RegisterService ¶ added in v0.6.0
func (s *Store) RegisterService(env, pool, hostIP string, container *docker.Container) (*ServiceRegistration, error)
func (*Store) UnRegisterService ¶ added in v0.6.0
func (s *Store) UnRegisterService(env, pool, hostIP string, container *docker.Container) (*ServiceRegistration, error)
func (*Store) Watch ¶
func (s *Store) Watch(env string, stop chan struct{}) chan *ConfigChange
Click to show internal directories.
Click to hide internal directories.