app

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: Unlicense Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Acks

type Acks struct {
	Buffer chan VoteAck
	WIP    bool
	Drop   chan bool
}

Acks is used to store and send ack messages stored if rate limit is reached

func NewAcks

func NewAcks() Acks

NewAcks is used to init a Acks struct

type Conf

type Conf struct {
	Pastebin PastebinCreds
	Twitch   TwitchCreds
	Stats    Stats
	Admins   []string
	Hello    string
	Prefix   string
	Verified bool
}

Conf is a meta structure containing all nedded configuration for a gambling instance

type Gambling

type Gambling struct {
	// Config from yaml file
	Config Conf
	// Twitch client
	Twitch *twitch.Client
	// Vote
	CurrentVote *Vote
	// whisper rate limiter
	WhispRL *rate.Limiter
	// Warning rate limiter
	WarnRL *rate.Limiter
}

Gambling is a meta structure containing all the stuff needed by a Gambling instance

func NewGambling

func NewGambling(confPath string) *Gambling

NewGambling func create a new Gambling struct

func (*Gambling) SendAcks

func (g *Gambling) SendAcks()

SendAcks is used to send Ack accumulted while rate limit is reached

func (*Gambling) Start

func (g *Gambling) Start() error

Start is used to connect a gamble-bot instance to a twitch channel, and start the bot

type PastebinCreds

type PastebinCreds struct {
	Key string
}

PastebinCreds is a structure contaning all credentials for Pastebin

type Statistics

type Statistics struct {
	Total       int
	Transformed map[string][]string
}

Statistics is a struct containing generated stats for a given vote

func NewStatistics

func NewStatistics(votes *Vote) Statistics

NewStatistics if used to transform a vote into a statistics struct

type Stats

type Stats struct {
	// Base dir path used to store generated files
	Dir string
}

Stats is a structure containing config related to stats generation

type TwitchCreds

type TwitchCreds struct {
	Channel  string
	Oauth    string
	Username string
}

TwitchCreds is a structure containing all credenials for Twitch

type Vote

type Vote struct {
	IsOpen        bool
	Possibilities []string
	Votes         map[string]string
	Acks          Acks
	Winners       []string
}

Vote is a structure handling all voting params and status

type VoteAck

type VoteAck struct {
	Username string
	// contains filtered or unexported fields
}

VoteAck is a struct containing vote acknolegment send later if rate limit is reached

func NewVoteAck

func NewVoteAck(message string, username string) VoteAck

NewVoteAck is used to init a VoteAck struct

Jump to

Keyboard shortcuts

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