mirror of
https://github.com/skidoodle/ncore-stats.git
synced 2026-04-28 07:47:36 +02:00
jo lesz az
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// Configuration holds application settings.
|
||||
type Configuration struct {
|
||||
ServerPort string
|
||||
DatabasePath string
|
||||
LogLevel logrus.Level
|
||||
Ncore struct {
|
||||
Nick string
|
||||
Pass string
|
||||
}
|
||||
}
|
||||
|
||||
// ProfileData represents a snapshot of a user's profile statistics.
|
||||
type ProfileData struct {
|
||||
Owner string `json:"owner"`
|
||||
Timestamp time.Time `json:"timestamp"`
|
||||
Rank int `json:"rank"`
|
||||
Upload string `json:"upload"`
|
||||
CurrentUpload string `json:"current_upload"`
|
||||
CurrentDownload string `json:"current_download"`
|
||||
Points int `json:"points"`
|
||||
SeedingCount int `json:"seeding_count"`
|
||||
}
|
||||
|
||||
// User represents a tracked user.
|
||||
type User struct {
|
||||
ID int
|
||||
DisplayName string
|
||||
ProfileID string
|
||||
}
|
||||
|
||||
type State struct {
|
||||
config *Configuration
|
||||
db *sql.DB
|
||||
client *http.Client
|
||||
}
|
||||
Reference in New Issue
Block a user