Documentation
¶
Index ¶
- Constants
- type MemoryBackend
- func (r *MemoryBackend) Connect()
- func (r *MemoryBackend) Delete(key string) (int, error)
- func (r *MemoryBackend) Expire(key string, ttl uint64) (int, error)
- func (r *MemoryBackend) Get(key, field string) (string, error)
- func (r *MemoryBackend) Keys(key string) ([]string, error)
- func (r *MemoryBackend) Reconnect()
- func (r *MemoryBackend) Set(key, field string, value string) (string, error)
- func (r *MemoryBackend) Ttl(key string) (int, error)
- type RedisBackend
- func (r *RedisBackend) AddMember(key, value string) (int, error)
- func (r *RedisBackend) Connect()
- func (r *RedisBackend) Delete(key string) (int, error)
- func (r *RedisBackend) DeleteMulti(key string, fields ...string) (int, error)
- func (r *RedisBackend) Expire(key string, ttl uint64) (int, error)
- func (r *RedisBackend) Get(key, field string) (string, error)
- func (r *RedisBackend) GetAll(key string) (map[string]string, error)
- func (r *RedisBackend) Keys(key string) ([]string, error)
- func (r *RedisBackend) Members(key string) ([]string, error)
- func (r *RedisBackend) Reconnect()
- func (r *RedisBackend) RemoveMember(key, value string) (int, 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) Ttl(key string) (int, error)
- type RegistryBackend
- type ServiceRegistration
- type ServiceRegistry
- func (r *ServiceRegistry) Connect(registryURL string)
- func (s *ServiceRegistry) EnvFor(container *docker.Container) map[string]string
- func (r *ServiceRegistry) GetServiceRegistration(env, pool, hostIP string, container *docker.Container) (*ServiceRegistration, error)
- func (r *ServiceRegistry) IsRegistered(env, pool, hostIP string, container *docker.Container) (bool, error)
- func (r *ServiceRegistry) ListRegistrations(env string) ([]ServiceRegistration, error)
- func (r *ServiceRegistry) RegisterService(env, pool, hostIP string, container *docker.Container) (*ServiceRegistration, error)
- func (r *ServiceRegistry) UnRegisterService(env, pool, hostIP string, container *docker.Container) (*ServiceRegistration, error)
- type Value
Constants ¶
View Source
const (
DefaultTTL = 60
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryBackend ¶
type MemoryBackend struct {
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) Connect ¶
func (r *MemoryBackend) Connect()
func (*MemoryBackend) Reconnect ¶
func (r *MemoryBackend) Reconnect()
type RedisBackend ¶
type RedisBackend struct {
RedisHost string
// contains filtered or unexported fields
}
func (*RedisBackend) Connect ¶
func (r *RedisBackend) Connect()
func (*RedisBackend) DeleteMulti ¶
func (r *RedisBackend) DeleteMulti(key string, fields ...string) (int, error)
func (*RedisBackend) Reconnect ¶
func (r *RedisBackend) Reconnect()
func (*RedisBackend) RemoveMember ¶
func (r *RedisBackend) RemoveMember(key, value string) (int, error)
func (*RedisBackend) Set ¶
func (r *RedisBackend) Set(key, field string, value string) (string, error)
type RegistryBackend ¶
type RegistryBackend interface {
// Keys
Keys(key string) ([]string, error)
Delete(key string) (int, error)
Expire(key string, ttl uint64) (int, error)
Ttl(key string) (int, error)
Connect()
Reconnect()
// Maps
Set(key, field string, value string) (string, error)
Get(key, field string) (string, error)
}
type ServiceRegistration ¶
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 ¶
func (s *ServiceRegistration) Equals(other ServiceRegistration) bool
func (*ServiceRegistration) ExternalAddr ¶
func (s *ServiceRegistration) ExternalAddr() string
func (*ServiceRegistration) InternalAddr ¶
func (s *ServiceRegistration) InternalAddr() string
type ServiceRegistry ¶
type ServiceRegistry struct {
Hostname string
TTL uint64
OutputBuffer *utils.OutputBuffer
// contains filtered or unexported fields
}
func NewServiceRegistry ¶
func NewServiceRegistry(ttl uint64) *ServiceRegistry
func (*ServiceRegistry) Connect ¶
func (r *ServiceRegistry) Connect(registryURL string)
Build the Redis Pool
func (*ServiceRegistry) EnvFor ¶
func (s *ServiceRegistry) EnvFor(container *docker.Container) map[string]string
func (*ServiceRegistry) GetServiceRegistration ¶
func (r *ServiceRegistry) GetServiceRegistration(env, pool, hostIP string, container *docker.Container) (*ServiceRegistration, error)
func (*ServiceRegistry) IsRegistered ¶
func (*ServiceRegistry) ListRegistrations ¶
func (r *ServiceRegistry) ListRegistrations(env string) ([]ServiceRegistration, error)
TODO: get all ServiceRegistrations
func (*ServiceRegistry) RegisterService ¶
func (r *ServiceRegistry) RegisterService(env, pool, hostIP string, container *docker.Container) (*ServiceRegistration, error)
func (*ServiceRegistry) UnRegisterService ¶
func (r *ServiceRegistry) UnRegisterService(env, pool, hostIP string, container *docker.Container) (*ServiceRegistration, error)
Click to show internal directories.
Click to hide internal directories.