Documentation ¶
Index ¶
- Constants
- func SetDomainPrefix(domainPrefix string)
- func SetServicePrefix(servicePrefix string)
- type Broadcaster
- type Domain
- type Location
- type Service
- type ServiceCluster
- func (cl *ServiceCluster) Add(service *Service)
- func (cl *ServiceCluster) Dump(action string)
- func (cl *ServiceCluster) Get(instanceIndex string) *Service
- func (cl *ServiceCluster) GetInstances() []*Service
- func (cl *ServiceCluster) Next() (*Service, error)
- func (cl *ServiceCluster) Remove(instanceIndex string)
- type ServiceConfig
- type Status
- type StatusError
- type Watcher
Constants ¶
View Source
const ( STARTING_STATUS = "starting" STARTED_STATUS = "started" STOPPING_STATUS = "stopping" STOPPED_STATUS = "stopped" ERROR_STATUS = "error" WARNING_STATUS = "warning" NA_STATUS = "n/a" PASSIVATED_STATUS = "passivated" )
View Source
const (
TIME_FORMAT = "2006-01-02 15:04:05"
)
Variables ¶
This section is empty.
Functions ¶
func SetDomainPrefix ¶
func SetDomainPrefix(domainPrefix string)
func SetServicePrefix ¶
func SetServicePrefix(servicePrefix string)
Types ¶
type Broadcaster ¶
type Broadcaster struct {
// contains filtered or unexported fields
}
func NewBroadcaster ¶
func NewBroadcaster() *Broadcaster
func (*Broadcaster) Listen ¶
func (b *Broadcaster) Listen() chan interface{}
func (*Broadcaster) Write ¶
func (b *Broadcaster) Write(message interface{})
type Location ¶
func (*Location) IsFullyDefined ¶
type Service ¶
type Service struct { Index string `json:"index"` NodeKey string `json:"nodeKey"` Location *Location `json:"location"` Domain string `json:"domain"` Name string `json:"name"` Status *Status `json:"status"` LastAccess *time.Time `json:"lastAccess"` Config *ServiceConfig `json:"config"` // contains filtered or unexported fields }
func (*Service) StartedSince ¶
type ServiceCluster ¶
type ServiceCluster struct { Name string `json:"name"` Instances []*Service `json:"instances"` // contains filtered or unexported fields }
func GetServiceClusterFromNode ¶
func GetServiceClusterFromNode(clusterNode *etcd.Node) *ServiceCluster
func GetServiceClusterFromPath ¶
func GetServiceClusterFromPath(serviceClusterPath string, client *etcd.Client) (*ServiceCluster, error)
func NewServiceCluster ¶
func NewServiceCluster(name string) *ServiceCluster
func (*ServiceCluster) Add ¶
func (cl *ServiceCluster) Add(service *Service)
func (*ServiceCluster) Dump ¶
func (cl *ServiceCluster) Dump(action string)
func (*ServiceCluster) Get ¶
func (cl *ServiceCluster) Get(instanceIndex string) *Service
Get an service by its key (index). Returns nil if not found.
func (*ServiceCluster) GetInstances ¶
func (cl *ServiceCluster) GetInstances() []*Service
func (*ServiceCluster) Next ¶
func (cl *ServiceCluster) Next() (*Service, error)
func (*ServiceCluster) Remove ¶
func (cl *ServiceCluster) Remove(instanceIndex string)
type ServiceConfig ¶
type ServiceConfig struct {
Robots string `json:"robots"`
}
func (*ServiceConfig) Equals ¶
func (config *ServiceConfig) Equals(other *ServiceConfig) bool
type Status ¶
type StatusError ¶
func (StatusError) Error ¶
func (s StatusError) Error() string
type Watcher ¶
type Watcher struct { Client *etcd.Client DomainPrefix string ServicePrefix string Domains map[string]*Domain Services map[string]*ServiceCluster // contains filtered or unexported fields }
A Watcher loads and watch the etcd hierarchy for Domains and Services.
func (*Watcher) RemoveDomain ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.