sweeper

package module
v0.0.0-...-a32040b Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: MIT Imports: 2 Imported by: 0

README

sweeper

Discord bot and services for the Corner Destiny 2 clan and community

Documentation

Index

Constants

View Source
const (
	Titan = iota + 1
	Hunter
	Warlock
)

Variables

View Source
var (
	ErrNoOpenSpots        = errors.New("no spots are open for this event")
	ErrUserAlreadyJoined  = errors.New("you are already in this event")
	ErrUserNotParticipant = errors.New("user is not a participant")
	ErrUserIsLeader       = errors.New("you are the fireteam leader of this event")
	ErrEventIsCancelled   = errors.New("event is cancelled")
)

Functions

This section is empty.

Types

type Activity

type Activity int
const (
	Raid Activity = iota + 1
	Trials
)

func (Activity) MemberCount

func (a Activity) MemberCount() int

func (Activity) String

func (a Activity) String() string

type Class

type Class int

func (Class) String

func (c Class) String() string

type Event

type Event struct {
	ID           Snowflake
	Activity     Activity
	Status       EventStatus
	Description  string
	Participants []*User
}

func NewEvent

func NewEvent(act Activity, leader *User, desc string) (*Event, error)

func (*Event) AddParticipant

func (e *Event) AddParticipant(user *User) error

func (*Event) Cancel

func (e *Event) Cancel()

func (*Event) Leader

func (e *Event) Leader() *User

func (*Event) RemoveParticipant

func (e *Event) RemoveParticipant(user *User) error

type EventRepository

type EventRepository interface {
	Store(event *Event) error
	FindAll() map[Snowflake]*Event
	Find(id Snowflake) (*Event, error)
	Remove(id Snowflake) error
}

type EventStatus

type EventStatus int
const (
	EventStatusSearching EventStatus = iota
	EventStatusFull
	EventStatusCancelled
)

type Snowflake

type Snowflake string

func NextSnowflake

func NextSnowflake() Snowflake

func (Snowflake) String

func (s Snowflake) String() string

type User

type User struct {
	ID       Snowflake
	Username string
	Class    Class
}

func (*User) SetClass

func (u *User) SetClass(c Class)

type UserRepository

type UserRepository interface {
	Find(id Snowflake) (*User, error)
	Store(u *User) error
}

Directories

Path Synopsis
cmd
appcmds command
sweeperbot command
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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