Documentation ¶
Index ¶
- type App
- type Conf
- type HttpError
- type ServerEntry
- type ServerPoint
- type Storage
- type StorageSqlite
- func (store *StorageSqlite) GetServer(id string) (ServerEntry, error)
- func (store *StorageSqlite) GetServerHistory(days int) ([]ServerPoint, error)
- func (store *StorageSqlite) GetServers() ([]ServerEntry, error)
- func (store *StorageSqlite) GetSingleServerHistory(id string, days int) ([]ServerPoint, error)
- func (store *StorageSqlite) Open() error
- func (store *StorageSqlite) RemoveServers(servers []ServerEntry) error
- func (store *StorageSqlite) SaveServerHistory(points []ServerPoint) error
- func (store *StorageSqlite) SaveServers(servers []ServerEntry) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServerEntry ¶
type ServerEntry struct { ID string `db:"id"` Title string `db:"title"` SiteURL string `db:"site_url"` GameURL string `db:"game_url"` Time time.Time `db:"time"` Players int `db:"players"` }
func (ServerEntry) ByondURL ¶
func (e ServerEntry) ByondURL() template.URL
func (ServerEntry) IsZero ¶
func (e ServerEntry) IsZero() bool
func (ServerEntry) LastUpdated ¶
func (e ServerEntry) LastUpdated() string
type ServerPoint ¶
type ServerPoint struct { Time time.Time `db:"time"` ServerID string `db:"server_id"` Players int `db:"players"` }
func (ServerPoint) IsZero ¶
func (p ServerPoint) IsZero() bool
type Storage ¶
type Storage interface { Open() error SaveServers([]ServerEntry) error GetServer(string) (ServerEntry, error) GetServers() ([]ServerEntry, error) RemoveServers([]ServerEntry) error SaveServerHistory([]ServerPoint) error GetServerHistory(int) ([]ServerPoint, error) GetSingleServerHistory(string, int) ([]ServerPoint, error) }
type StorageSqlite ¶
func (*StorageSqlite) GetServer ¶
func (store *StorageSqlite) GetServer(id string) (ServerEntry, error)
func (*StorageSqlite) GetServerHistory ¶
func (store *StorageSqlite) GetServerHistory(days int) ([]ServerPoint, error)
func (*StorageSqlite) GetServers ¶
func (store *StorageSqlite) GetServers() ([]ServerEntry, error)
func (*StorageSqlite) GetSingleServerHistory ¶
func (store *StorageSqlite) GetSingleServerHistory(id string, days int) ([]ServerPoint, error)
func (*StorageSqlite) Open ¶
func (store *StorageSqlite) Open() error
func (*StorageSqlite) RemoveServers ¶
func (store *StorageSqlite) RemoveServers(servers []ServerEntry) error
func (*StorageSqlite) SaveServerHistory ¶
func (store *StorageSqlite) SaveServerHistory(points []ServerPoint) error
func (*StorageSqlite) SaveServers ¶
func (store *StorageSqlite) SaveServers(servers []ServerEntry) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.