Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Representative ¶
type Representative struct {
// contains filtered or unexported fields
}
Representative is an instance of saltbot. It can either represent the leader or follower. Leaders do all the work. Followers wait until the the leader dies and performs leader election to elect the new leader.
func New ¶
func New(session *discordgo.Session, h *handler.SaltbotHandler, c *cache.ResourceCache, ctx context.Context) (*Representative, error)
func (*Representative) Run ¶
func (r *Representative) Run()
Run the leader election and acquire the lease as determined by the $HOSTNAME environment variable. If that variable is not present, the representative will acquire the lease as a UUID instead.
Click to show internal directories.
Click to hide internal directories.