Documentation
¶
Index ¶
Constants ¶
View Source
const ( TrashTypeCardboard = "cardboard" TrashTypeGlass = "glass" TrashTypeMetal = "metal" TrashTypePaper = "paper" TrashTypePlastic = "plastic" TrashTypeTrash = "trash" TrashTypeUndefined = "undefined" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Achievement ¶
type Achievement struct {
}
type LoginHistory ¶
type LoginHistory db.LoginHistory
type Prediction ¶
type Prediction struct {
ID uuid.UUID `json:"id"`
UserID uuid.UUID `json:"user_id"`
TrashScan string `json:"scan_key"`
Status PredictionStatus `json:"status"`
Result PredictionResult `json:"result"`
Error string `json:"error"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func NewPredictionsList ¶
func NewPredictionsList(predictions []db.Prediction) []*Prediction
func (Prediction) IsValid ¶
func (pr Prediction) IsValid() bool
func (*Prediction) Model ¶
func (pr *Prediction) Model(prediction db.Prediction)
type PredictionResult ¶
func NewPredictionResult ¶
func NewPredictionResult(m map[uint8]float64) PredictionResult
type PredictionStatus ¶
type PredictionStatus string
const ( PredictionProcessingStatus PredictionStatus = "processing" PredictionCompletedStatus PredictionStatus = "completed" PredictionFailedStatus PredictionStatus = "failed" )
func (PredictionStatus) IsValid ¶
func (st PredictionStatus) IsValid() bool
func (PredictionStatus) String ¶
func (st PredictionStatus) String() string
type RefreshToken ¶
type RefreshToken db.RefreshToken
func NewRefreshFromClaims ¶
func NewRefreshFromClaims(hash string, claims jwt.RegisteredClaims) *RefreshToken
type Stat ¶
type Stat struct {
ID uuid.UUID `json:"id"`
Status UserStatus `json:"status"`
Rating int `json:"rating"`
FilesScanned int `json:"files_scanned"`
TotalWeight float64 `json:"total_weight"`
LastScannedAt time.Time `json:"last_scanned_at,omitempty"`
Achievements []Achievement `json:"-"`
TrashByTypes map[string]int `json:"trash_by_types"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type User ¶
type User struct {
ID uuid.UUID `json:"id"`
Login string `json:"login"`
Name string `json:"name"`
HashedPassword string `json:"-"`
Avatar *string `json:"avatar,omitempty"`
Stat *Stat `json:"stat,omitempty"`
Deleted bool `json:"-"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type UserStatus ¶
type UserStatus string
const ( UserStatusNewbie UserStatus = "newbie" // Новичок 0 UserStatusEcoScout UserStatus = "eco_scout" // Эко-разведчик 100+ UserStatusGreenGuard UserStatus = "green_guard" // Зеленый страж 300+ UserStatusEcoWarrior UserStatus = "eco_warrior" // Эко-воин 500+ UserStatusNatureHero UserStatus = "nature_hero" // Герой природы 1000+ UserStatusEarthDefend UserStatus = "earth_defender" // Защитник Земли 1500+ UserStatusEcoChampion UserStatus = "eco_champion" // Эко-чемпион 3000+ UserStatusPlanetGuard UserStatus = "planet_guardian" // Хранитель планеты 5000+ UserStatusEcoLegend UserStatus = "eco_legend" // Эко-легенда 10000+ )
func (UserStatus) Valid ¶
func (s UserStatus) Valid() bool
Click to show internal directories.
Click to hide internal directories.