mewldresponder

package
v0.0.0-...-c1401b0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MewldDiagPayload

type MewldDiagPayload struct {
	ClusterID uint16 `json:"id"`
	Nonce     string `json:"nonce"`
	Diag      bool   `json:"diag"`
}

type MewldDiagResponse

type MewldDiagResponse struct {
	ClusterID uint16                 `json:"cluster_id"`
	Nonce     string                 `json:"Nonce"`
	Data      []MewldDiagShardHealth `json:"Data"`
}

type MewldDiagShardHealth

type MewldDiagShardHealth struct {
	ShardID uint16  `json:"shard_id"`
	Up      bool    `json:"up"`
	Latency float64 `json:"latency"`
	Guilds  uint64  `json:"guilds"`
	Users   uint64  `json:"users"`
}

type MewldResponder

type MewldResponder struct {
	ClusterID             uint16
	ClusterName           string
	Shards                []uint16
	Channel               string
	OnDiag                func(p *MewldDiagPayload) (*MewldDiagResponse, error)
	OnAllClustersLaunched func() error
	OnLaunchNext          func() error
	OnLauncherCmd         func(cmd mredis.LauncherCmd) error
}

func (*MewldResponder) LaunchNext

func (c *MewldResponder) LaunchNext(ctx context.Context, redis rueidis.Client, l *zap.Logger) error

Sends the launch_next command

func (*MewldResponder) Listen

func (c *MewldResponder) Listen(ctx context.Context, redis rueidis.Client, l *zap.Logger) error

Listen starts listening for messages from redis and restarts the listener if it dies

func (*MewldResponder) ListenOnce

func (c *MewldResponder) ListenOnce(ctx context.Context, r rueidis.Client, l *zap.Logger) error

ListenOnce starts listening for messages from redis

This is *blocking* and should be run in a goroutine

Jump to

Keyboard shortcuts

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