Documentation
¶
Index ¶
- Constants
- 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) 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) Connect()
- 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 *AppConfig, 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) (*AppConfig, error)
- func (r *MemoryBackend) Keys(key string) ([]string, error)
- func (r *MemoryBackend) ListApps(env string) ([]*AppConfig, 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) Reconnect()
- 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 *AppConfig, 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) Connect()
- 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 *AppConfig, 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) (*AppConfig, error)
- func (r *RedisBackend) Keys(key string) ([]string, error)
- func (r *RedisBackend) ListApps(env string) ([]*AppConfig, 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) Reconnect()
- 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(svcCfg *AppConfig, env string) (bool, error)
- func (r *RedisBackend) UpdateHost(env, pool string, host HostInfo) error
- type Store
- func (r *Store) AppExists(app, env string) (bool, error)
- func (r *Store) AssignApp(app, env, pool string) (bool, error)
- func (r *Store) CheckForChangesNow()
- func (r *Store) Connect(registryURL string)
- func (r *Store) CreateApp(app, env string) (bool, error)
- func (r *Store) CreatePool(name, env string) (bool, error)
- func (r *Store) DeleteApp(app, env string) (bool, error)
- func (r *Store) DeleteHost(env, pool string, host HostInfo) error
- func (r *Store) DeletePool(pool, env string) (bool, error)
- func (r *Store) GetApp(app, env string) (*AppConfig, error)
- func (r *Store) ListApps(env string) ([]*AppConfig, error)
- func (r *Store) ListAssignedPools(env, app string) ([]string, error)
- func (r *Store) ListAssignments(env, pool string) ([]string, error)
- func (r *Store) ListEnvs() ([]string, error)
- func (r *Store) ListHosts(env, pool string) ([]HostInfo, error)
- func (r *Store) ListPools(env string) ([]string, error)
- func (r *Store) NotifyEnvChanged(env string) error
- func (r *Store) NotifyRestart(app, env string) error
- func (r *Store) PoolExists(env, pool string) (bool, error)
- func (r *Store) UnassignApp(app, env, pool string) (bool, error)
- func (r *Store) UpdateApp(svcCfg *AppConfig, env string) (bool, error)
- func (r *Store) UpdateHost(env, pool string, host HostInfo) error
- func (r *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 AppConfig ¶
type AppConfig struct {
// ID is used for ordering and conflict resolution.
// Usualy set to time.Now().UnixNano()
Name string `redis:"name"`
// contains filtered or unexported fields
}
func NewAppConfig ¶
func NewAppConfigWithEnv ¶
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) ([]*AppConfig, error)
GetApp(app, env string) (*AppConfig, error)
UpdateApp(svcCfg *AppConfig, env string) (bool, error)
DeleteApp(svcCfg *AppConfig, 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)
Connect()
Reconnect()
}
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) (*AppConfig, error)
UpdateAppFunc func(svcCfg *AppConfig, env string) (bool, error)
DeleteAppFunc func(svcCfg *AppConfig, 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) Connect ¶
func (r *MemoryBackend) Connect()
func (*MemoryBackend) CreatePool ¶
func (r *MemoryBackend) CreatePool(env, pool string) (bool, error)
func (*MemoryBackend) DeleteApp ¶
func (r *MemoryBackend) DeleteApp(svcCfg *AppConfig, 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) Reconnect ¶
func (r *MemoryBackend) Reconnect()
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 *AppConfig, 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) Connect ¶
func (r *RedisBackend) Connect()
func (*RedisBackend) CreatePool ¶
func (r *RedisBackend) CreatePool(env, pool string) (bool, error)
func (*RedisBackend) DeleteApp ¶
func (r *RedisBackend) DeleteApp(svcCfg *AppConfig, 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) Reconnect ¶
func (r *RedisBackend) Reconnect()
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(svcCfg *AppConfig, env string) (bool, error)
func (*RedisBackend) UpdateHost ¶
func (r *RedisBackend) UpdateHost(env, pool string, host HostInfo) error
type Store ¶
type Store struct {
Backend Backend
Hostname string
TTL uint64
OutputBuffer *utils.OutputBuffer
// contains filtered or unexported fields
}
func (*Store) CheckForChangesNow ¶
func (r *Store) CheckForChangesNow()
func (*Store) ListAssignedPools ¶
func (*Store) NotifyEnvChanged ¶
func (*Store) NotifyRestart ¶
func (*Store) Watch ¶
func (r *Store) Watch(env string, stop chan struct{}) chan *ConfigChange
Click to show internal directories.
Click to hide internal directories.