Esempio n. 1
0
File: lb.go Progetto: 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
}
Esempio 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,
	}
}