Beispiel #1
0
// 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
}
Beispiel #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,
	}
}