Documentation ¶
Index ¶
- func ContextWithApp(ctx context.Context, app *App) context.Context
- func FS() fs.FS
- func OnStart(name string, fn HookFunc)
- func WaitExitSignal() os.Signal
- type AllowedAdmin
- type AllowedMod
- type App
- func AppFromContext(ctx context.Context) *App
- func New(ctx context.Context, cfg *AppConfig) *App
- func Start(ctx context.Context, service, envName, token, guild string) (context.Context, *App, error)
- func StartCLI(c *cli.Context) (context.Context, *App, error)
- func StartConfig(ctx context.Context, cfg *AppConfig) (context.Context, *App, error)
- func (app *App) Config() *AppConfig
- func (app *App) Context() context.Context
- func (app *App) DB() *bun.DB
- func (app *App) IsDebug() bool
- func (app *App) OnAfterStop(name string, fn HookFunc)
- func (app *App) OnStop(name string, fn HookFunc)
- func (app *App) Running() bool
- func (app *App) Stop()
- func (app *App) Stopping() bool
- type AppConfig
- type HookFunc
- type League
- type LedgerEntry
- type ParticipantPointTotal
- type Season
- type Task
- type TaskCollection
- type TaskParticipantRestriction
- type TaskType
- type Team
- type TeamPointTotal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WaitExitSignal ¶
Types ¶
type AllowedAdmin ¶
type AllowedMod ¶
type AppConfig ¶
type LedgerEntry ¶
type LedgerEntry struct { bun.BaseModel `bun:"ledger_entry"` DiscordGuildID uint64 `bun:",pk,notnull"` LedgerEntryID uint64 `bun:",pk,nullzero,notnull,default:'unknown'"` EffectiveDatetime time.Time `bun:",notnull,default:current_timestamp"` DiscordUserID uint64 `bun:",nullzero"` TeamID uint32 `bun:",nullzero"` Team *Team `bun:"rel:belongs-to,join:discord_guild_id=discord_guild_id,team_id=team_id"` TaskID uint64 `bun:",notnull"` Task *Task `bun:"rel:belongs-to,join:discord_guild_id=discord_guild_id,task_id=task_id"` DiffPointBase int32 `bun:",notnull"` DiffPointBonus int32 `bun:",notnull"` }
type ParticipantPointTotal ¶
type Task ¶
type Task struct { bun.BaseModel `bun:"task"` DiscordGuildID uint64 `bun:",pk,notnull"` TaskID uint64 `bun:",pk,nullzero,notnull,default:'unknown'"` FriendlyName string `bun:",notnull"` PointBase uint32 `bun:",notnull"` PointBonus uint32 `bun:",notnull"` OpenDatetime time.Time `bun:",nullzero,notnull,default:current_timestamp"` CloseDatetime time.Time `bun:",nullzero"` PerParticipantLimit uint16 `bun:",nullzero"` TaskTypeID uint64 `bun:",nullzero"` TaskType *TaskType `bun:"rel:belongs-to,join:discord_guild_id=discord_guild_id,task_type_id=task_type_id"` TaskCollectionID uint64 `bun:",nullzero"` TaskCollection *TaskCollection `bun:"rel:belongs-to,join:discord_guild_id=discord_guild_id,task_collection_id=task_collection_id"` AdditionalInfo map[string]interface{} `bun:",nullzero"` LedgerEntry []*LedgerEntry `bun:"rel:has-many,join:discord_guild_id=discord_guild_id,task_id=task_id"` TaskParticipantRestriction []*TaskParticipantRestriction `bun:"rel:has-many,join:discord_guild_id=discord_guild_id,task_participant_restriction_id=task_participant_restriction_id"` }
type TaskCollection ¶
type TaskCollection struct { bun.BaseModel `bun:"task_collection"` DiscordGuildID uint64 `bun:",pk,notnull"` TaskCollectionID uint32 `bun:",pk,nullzero,notnull,default:'unknown'"` FriendlyName string `bun:",notnull"` Task []*Task `bun:"rel:has-many,join:discord_guild_id=discord_guild_id,task_id=task_id"` }
type TaskParticipantRestriction ¶
type TaskParticipantRestriction struct { bun.BaseModel `bun:"task_participant_restriction"` DiscordGuildID uint64 `bun:",pk,notnull"` TaskParticipantRestrictionID uint32 `bun:",pk,nullzero,notnull,default:'unknown'"` TaskID uint64 `bun:",notnull"` Task *Task `bun:"rel:belongs-to,join:discord_guild_id=discord_guild_id,task_id=task_id"` DiscordUserID uint64 `bun:",notnull"` ExpirationDatetime time.Time `bun:",nullzero"` }
type TaskType ¶
type TaskType struct { bun.BaseModel `bun:"task_type"` DiscordGuildID uint64 `bun:",pk,notnull"` TaskTypeID uint32 `bun:",pk,nullzero,notnull,default:'unknown'"` FriendlyName string `bun:",notnull"` ParentTaskTypeID uint64 `bun:",nullzero"` ParentTaskType *TaskType `bun:"rel:belongs-to,join:discord_guild_id=discord_guild_id,parent_task_type_id=task_type_id"` Task []*Task `bun:"rel:has-many,join:discord_guild_id=discord_guild-id,task_id=task_id"` }
type Team ¶
type Team struct { bun.BaseModel `bun:"team"` DiscordGuildID uint64 `bun:",pk,notnull"` TeamID uint32 `bun:",pk,nullzero,notnull"` DiscordRoleID uint64 `bun:",notnull"` LeagueID uint32 `bun:",nullzero"` League *League `bun:"rel:belongs-to,join:discord_guild_id=discord_guild_id,league_id=league_id"` LedgerEntry []*LedgerEntry `bun:"rel:has-many,join:discord_guild_id=discord_guild_id,team_id=team_id"` }
Team is a roleID that can collect points and have members
Click to show internal directories.
Click to hide internal directories.