Exemplo n.º 1
0
Arquivo: lb.go Projeto: fkasper/core
// NewLBRegistry creates a new LBRegistry from the provided etcd Client.
func NewLBRegistry(key string, ttl uint64) (*LBRegistry, error) {
	client := vulcan.NewClient(key)

	return &LBRegistry{
		Key:    key,
		TTL:    ttl,
		client: client,
	}, nil
}
Exemplo n.º 2
0
// NewLeaderRegistry creates a new LeaderRegistry from the provided etcd Client.
func NewLeaderRegistry(key string, group string, ttl uint64) *LeaderRegistry {
	client := vulcan.NewClient(key)

	return &LeaderRegistry{
		Key:      key,
		Group:    group,
		TTL:      ttl,
		client:   client,
		IsMaster: false,
	}
}