slave

package
v1.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot interface {
	// Called when a soft start is initiated, make sure to send a EvtSoftStartComplete when completed
	SoftStart()
	// Called when a full start is initiated, either after softstart or immediately (in case were doing a cold start)
	FullStart()

	// Caled when the bot should shut down, make sure to send EvtShutdown when completed
	Shutdown()

	StartShardTransferTo(numShards int)
	StartShardTransferFrom() (numShards int)
	StopShard(shard int) (sessionID string, sequence int64)
	StartShard(shard int, sessionID string, sequence int64)
	LoadGuildState(data *master.GuildStateData)
}

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

Conn is a wrapper around master.Conn, and represents a connection to the master

func ConnectToMaster

func ConnectToMaster(bot Bot, addr string) (*Conn, error)

ConnectToMaster attempts to connect to master ,if it fails it will launch a reconnect loop and wait until the master appears

func (*Conn) Send

func (c *Conn) Send(evtID master.EventType, body interface{}, queueFailed bool) error

Send sends the message to the master, if the connection is closed it will queue the message if queueFailed is set

func (*Conn) SendLogErr

func (c *Conn) SendLogErr(evtID master.EventType, body interface{}, queueFailed bool)

func (*Conn) TryReconnect

func (c *Conn) TryReconnect(running bool) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL