Documentation
¶
Index ¶
Constants ¶
Variables ¶
View Source
var ManagerSessionTTL = 60
ManagerSessionTTL is the etcd session's TTL in seconds. It's exported for testing.
Functions ¶
Types ¶
type Manager ¶
type Manager interface {
// ID returns the ID of the manager.
ID() string
// IsOwner returns whether the ownerManager is the owner.
IsOwner() bool
// SetOwner sets whether the ownerManager is the owner.
SetOwner(isOwner bool)
// GetOwnerID gets the owner ID.
GetOwnerID(ctx goctx.Context) (string, error)
// CampaignOwner campaigns the owner.
CampaignOwner(ctx goctx.Context) error
// Cancel cancels this etcd ownerManager campaign.
Cancel()
}
Manager is used to campaign the owner and manage the owner information.
func NewMockManager ¶
func NewMockManager(id string, cancel goctx.CancelFunc) Manager
NewMockManager creates a new mock Manager.
Source Files
¶
- manager.go
- mock.go
Click to show internal directories.
Click to hide internal directories.