dcbot/internal/domain/tribe.go
Dawid Wysokiński cfbaba198a
All checks were successful
ci/woodpecker/push/govulncheck Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
refactor: twhelp - migrate to /v2 API endpoints (#155)
Reviewed-on: #155
2024-05-02 05:57:24 +00:00

75 lines
1.4 KiB
Go

package domain
import (
"fmt"
"time"
)
type Tribe struct {
ID int
Tag string
Name string
ProfileURL string
DeletedAt time.Time
}
type TribeMeta struct {
ID int
Name string
Tag string
ProfileURL string
}
type NullTribeMeta struct {
Tribe TribeMeta
Valid bool
}
type TribeTagNotFoundError struct {
VersionCode string
ServerKey string
Tag string
}
var _ TranslatableError = TribeTagNotFoundError{}
func (e TribeTagNotFoundError) Error() string {
return fmt.Sprintf("tribe (VersionCode=%s,ServerKey=%s,Tag=%s) not found", e.VersionCode, e.ServerKey, e.Tag)
}
func (e TribeTagNotFoundError) Slug() string {
return "tribe-tag-not-found"
}
func (e TribeTagNotFoundError) Params() map[string]any {
return map[string]any{
"VersionCode": e.VersionCode,
"ServerKey": e.ServerKey,
"Tag": e.Tag,
}
}
type TribeIDNotFoundError struct {
VersionCode string
ServerKey string
ID int
}
var _ TranslatableError = TribeIDNotFoundError{}
func (e TribeIDNotFoundError) Error() string {
return fmt.Sprintf("tribe (VersionCode=%s,ServerKey=%s,ID=%d) not found", e.VersionCode, e.ServerKey, e.ID)
}
func (e TribeIDNotFoundError) Slug() string {
return "tribe-id-not-found"
}
func (e TribeIDNotFoundError) Params() map[string]any {
return map[string]any{
"VersionCode": e.VersionCode,
"ServerKey": e.ServerKey,
"ID": e.ID,
}
}