osrs

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: BSD-2-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BossAggregation

type BossAggregation string
const (
	AggregationSum BossAggregation = "sum"
	AggregationMax BossAggregation = "max"
)

type BossCategory

type BossCategory string
const (
	CategoryBoss    BossCategory = "boss"
	CategoryRaid    BossCategory = "raid"
	CategoryAgility BossCategory = "agility"
	CategoryOther   BossCategory = "other"
)

type BossKill

type BossKill struct {
	ID         int64     `json:"id"`
	PlayerName string    `json:"playerName"`
	BossName   string    `json:"bossName"`
	KillCount  *int      `json:"killCount,omitempty"`
	KilledAt   time.Time `json:"killedAt"`
}

type BossKillEvent

type BossKillEvent struct {
	BossKill
	SecondsSinceLastKill *float64 `json:"secondsSinceLastKill,omitempty"`
	IsAgility            bool     `json:"isAgility,omitempty"`
	DisplayName          string   `json:"displayName,omitempty"`
}

type Config

type Config struct {
	// SigningSecret HMAC key for signed cookies (API keys, admin sessions, CSRF).
	// If empty, an ephemeral secret is generated on startup.
	SigningSecret string

	// CookieSecure sets the Secure flag on cookies (default true).
	CookieSecure bool

	// ExternalLayoutPath, if set, uses this layout template file instead of the
	// embedded default. Used by flati.is to wrap pages in the site shell.
	ExternalLayoutPath string
}

Config configures the OSRS boss tracker HTTP handlers and dashboard.

type GimGroup

type GimGroup struct {
	ID       int
	Name     string
	APIKey   string
	AdminKey string
}

type OsrsCreateData

type OsrsCreateData struct {
	Title     string
	CSRFToken string
	Error     string
	Name      string
	Members   string
}

type OsrsCreateSuccessData

type OsrsCreateSuccessData struct {
	Title     string
	GroupName string
	APIKey    string
	AdminKey  string
}

type OsrsGroupListData

type OsrsGroupListData struct {
	Title     string
	Groups    []OsrsGroupSummary
	CSRFToken string
	Error     string
}

type OsrsGroupSummary

type OsrsGroupSummary struct {
	Name    string
	Players []string
}

type OsrsManageData

type OsrsManageData struct {
	Title         string
	GroupName     string
	CSRFToken     string
	Error         string
	Success       string
	Members       []string
	Authenticated bool
}

type OsrsPageData

type OsrsPageData struct {
	Title           string
	GroupName       string
	KCMatrix        map[string]map[string]int
	Players         []string
	Bosses          []string
	Raids           []string
	Agility         []string
	OtherBosses     []string
	BossTotals      map[string]int
	RaidTotals      map[string]int
	AgilityTotals   map[string]int
	OtherTotals     map[string]int
	TotalKillEvents int
	PlayersJSON     template.JS
}

type OsrsUnlockData

type OsrsUnlockData struct {
	Title       string
	CSRFToken   string
	Error       string
	Redirect    string
	ShowBack    bool
	InlineGroup string
}

type PlayerBossKC

type PlayerBossKC struct {
	PlayerName string    `json:"playerName"`
	BossName   string    `json:"bossName"`
	KillCount  int       `json:"killCount"`
	UpdatedAt  time.Time `json:"updatedAt"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server holds OSRS boss tracker state and HTTP handlers.

func NewServer

func NewServer(db *sql.DB, cfg Config) *Server

NewServer creates a Server without registering routes.

func Register

func Register(mux *http.ServeMux, db *sql.DB, cfg Config) *Server

Register mounts OSRS routes on mux. Pass nil to use http.DefaultServeMux.

Jump to

Keyboard shortcuts

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