task

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: May 30, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const IDLength = 10
View Source
const JobTTLSeconds = 3600

Variables

This section is empty.

Functions

func Ack

func Ack(ctx context.Context, redis *redis.Client, connCode string)

func AckSubscribe

func AckSubscribe(ctx context.Context, redis *redis.Client, connCode string) *redis.PubSub

func ApplyMuteDeaf

func ApplyMuteDeaf(sess *discordgo.Session, guildID, userID string, mute, deaf bool) error

func PushJob

func PushJob(ctx context.Context, redis *redis.Client, connCode string, jobType JobType, payload string) error

func Subscribe

func Subscribe(ctx context.Context, redis *redis.Client, connCode string) *redis.PubSub

Types

type Job

type Job struct {
	JobType JobType     `json:"type"`
	Payload interface{} `json:"payload"`
}

func PopJob

func PopJob(ctx context.Context, redis *redis.Client, connCode string) (Job, error)

type JobType

type JobType int
const (
	ConnectionJob JobType = iota
	LobbyJob
	StateJob
	PlayerJob
	GameOverJob
)

type ModifyTask

type ModifyTask struct {
	GuildID    uint64      `json:"guildID"`
	UserID     uint64      `json:"userID"`
	Parameters PatchParams `json:"parameters"`
	TaskID     string      `json:"taskID"`
}

func NewModifyTask

func NewModifyTask(guildID, userID uint64, params PatchParams) ModifyTask

type MuteDeafenSuccessCounts

type MuteDeafenSuccessCounts struct {
	Worker    int64 `json:"worker"`
	Capture   int64 `json:"capture"`
	Official  int64 `json:"official"`
	RateLimit int64 `json:"ratelimit"`
}

a response indicating how the mutes/deafens were issued, and if ratelimits occurred

type PatchParams

type PatchParams struct {
	Deaf bool `json:"deaf"`
	Mute bool `json:"mute"`
}

type UserModify

type UserModify struct {
	UserID uint64 `json:"userID"`
	Mute   bool   `json:"mute"`
	Deaf   bool   `json:"deaf"`
}

type UserModifyRequest

type UserModifyRequest struct {
	Premium premium.Tier `json:"premium"`
	Users   []UserModify `json:"users"`
}

Jump to

Keyboard shortcuts

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