Documentation ¶
Index ¶
- Constants
- Variables
- func HandleMessageCreate(evt *eventsystem.EventData) (retry bool, err error)
- func HandleSaveStatsSettings(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)
- func HandleStatsCharts(w http.ResponseWriter, r *http.Request, isPublicAccess bool) interface{}
- func HandleStatsHtml(w http.ResponseWriter, r *http.Request, isPublicAccess bool) (web.TemplateData, error)
- func HandleStatsJson(w http.ResponseWriter, r *http.Request, isPublicAccess bool) interface{}
- func MarkGuildAsToBeChecked(guildID int64)
- func RegisterPlugin()
- func RoundHour(t time.Time) time.Time
- func StartMigrationToV2Format() error
- type ChannelStats
- type ChartDataPeriod
- type ChartResponse
- type CompressedStats
- type Compressor
- type DailyStats
- type FormData
- type GuildStatsFrame
- type MigrationProgress
- type MigrationSubProgress
- type Plugin
- func (p *Plugin) AddCommands()
- func (p *Plugin) BotInit()
- func (p *Plugin) InitWeb()
- func (p *Plugin) LoadServerHomeWidget(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)
- func (p *Plugin) OnNewPremiumGuild(guildID int64) error
- func (p *Plugin) PluginInfo() *common.PluginInfo
- func (p *Plugin) RunBackgroundWorker()
- func (p *Plugin) StopBackgroundWorker(wg *sync.WaitGroup)
- type QueuedAction
- type ServerStatsConfig
Constants ¶
View Source
const (
RedisKeyLastHourlyRan = "serverstats_last_hourly_worker_ran"
)
Variables ¶
View Source
var PageHTML string
View Source
var WebConfigCache = rcache.NewInt(cacheConfigFetcher, time.Minute)
View Source
var WebStatsCache = rcache.New(cacheChartFetcher, time.Minute)
Functions ¶
func HandleMessageCreate ¶
func HandleMessageCreate(evt *eventsystem.EventData) (retry bool, err error)
func HandleSaveStatsSettings ¶ added in v1.4.1
func HandleSaveStatsSettings(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)
func HandleStatsCharts ¶ added in v1.16.0
func HandleStatsCharts(w http.ResponseWriter, r *http.Request, isPublicAccess bool) interface{}
func HandleStatsHtml ¶
func HandleStatsHtml(w http.ResponseWriter, r *http.Request, isPublicAccess bool) (web.TemplateData, error)
Somewhat dirty - should clean up this mess sometime
func HandleStatsJson ¶
func HandleStatsJson(w http.ResponseWriter, r *http.Request, isPublicAccess bool) interface{}
func MarkGuildAsToBeChecked ¶
func MarkGuildAsToBeChecked(guildID int64)
func RegisterPlugin ¶
func RegisterPlugin()
func StartMigrationToV2Format ¶ added in v1.31.10
func StartMigrationToV2Format() error
Types ¶
type ChannelStats ¶
type ChartDataPeriod ¶ added in v1.31.10
type ChartDataPeriod struct { T time.Time `json:"t"` Joins int `json:"joins"` Leaves int `json:"leaves"` NumMembers int `json:"num_members"` MaxOnline int `json:"max_online"` Messages int `json:"num_messages"` }
func RetrieveChartDataPeriods ¶ added in v1.31.10
type ChartResponse ¶ added in v1.16.0
type ChartResponse struct { Days int `json:"days"` Data []*ChartDataPeriod `json:"data"` }
func CacheGetCharts ¶ added in v1.16.0
func CacheGetCharts(guildID int64, days int, ctx context.Context) *ChartResponse
type CompressedStats ¶ added in v1.31.10
type Compressor ¶ added in v1.31.10
type Compressor struct {
// contains filtered or unexported fields
}
func (*Compressor) RunCompressionLegacy ¶ added in v1.31.10
func (c *Compressor) RunCompressionLegacy(t time.Time) error
type DailyStats ¶ added in v1.16.0
type DailyStats struct { ChannelMessages map[string]*ChannelStats `json:"channels_messages"` JoinedDay int `json:"joined_day"` LeftDay int `json:"left_day"` Online int `json:"online_now"` TotalMembers int `json:"total_members_now"` }
func RetrieveDailyStats ¶ added in v1.16.0
func RetrieveDailyStats(t time.Time, guildID int64) (*DailyStats, error)
type GuildStatsFrame ¶ added in v1.31.10
type MigrationProgress ¶ added in v1.31.10
type MigrationProgress struct { MsgPeriods *MigrationSubProgress MemberPeriods *MigrationSubProgress }
func GetMigrationV2Progress ¶ added in v1.31.10
func GetMigrationV2Progress() (*MigrationProgress, error)
type MigrationSubProgress ¶ added in v1.31.10
func (*MigrationSubProgress) IsRunning ¶ added in v1.31.10
func (m *MigrationSubProgress) IsRunning() bool
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func (*Plugin) AddCommands ¶ added in v1.4.1
func (p *Plugin) AddCommands()
func (*Plugin) LoadServerHomeWidget ¶ added in v1.17.0
func (p *Plugin) LoadServerHomeWidget(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)
func (*Plugin) OnNewPremiumGuild ¶ added in v1.31.10
func (*Plugin) PluginInfo ¶ added in v1.17.0
func (p *Plugin) PluginInfo() *common.PluginInfo
func (*Plugin) RunBackgroundWorker ¶ added in v1.11.0
func (p *Plugin) RunBackgroundWorker()
func (*Plugin) StopBackgroundWorker ¶ added in v1.11.0
type QueuedAction ¶ added in v1.31.10
type ServerStatsConfig ¶
ServerStatsConfig represents a configuration for a server reason we dont reference the model directly is because i need to figure out a way to migrate them over to the new schema, painlessly.
func BotCachedFetchGuildConfig ¶ added in v1.7.4
func BotCachedFetchGuildConfig(ctx context.Context, guildID int64) (*ServerStatsConfig, error)
func GetConfigWeb ¶ added in v1.31.10
func GetConfigWeb(guildID int64) *ServerStatsConfig
func (*ServerStatsConfig) ParseChannels ¶ added in v1.7.4
func (s *ServerStatsConfig) ParseChannels()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.