Documentation
¶
Index ¶
- Variables
- func CategoryIdApiMapping(id int) string
- func CategoryIdMapping(id int) string
- func CleanJSON(jsonStr string) string
- func Concat[T any](first []T, second []T) []T
- func CurrentRedBlueVersionStr(redBlueValue bool) string
- func DownloadExtract(filename string, dockerMountDataPath string, releaseUrl string) error
- func DownloadImages(dockerMountDataPath string, releaseUrl string) error
- func ExtractTarGz(baseDir string, gzipStream io.Reader) error
- func ImageUrls(iconId int, apiType string, resolutions []string, apiScheme string, ...) []string
- func LoadPersistedElements(elementsUrl string, typesUrl string) (PersistentStringKeysMap, PersistentStringKeysMap, error)
- func Max(a, b int) int
- func Min(a, b int) int
- func NextRedBlueVersionStr(redBlueValue bool) string
- func PartitionSlice[T any](items []T, parts int) (chunks [][]T)
- func SetJsonHeader(w *http.ResponseWriter)
- func Values[M ~map[K]V, K comparable, V any](m M) []V
- func WriteCacheHeader(w *http.ResponseWriter)
- type GameVersion
- type Pagination
- type PaginationLinks
- type PersistentStringKeysMap
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RequestsTotal = promauto.NewCounter(prometheus.CounterOpts{ Name: "dofus_requestsTotal", Help: "The total number of processed requests over all endpoints", }) RequestsSearchTotal = promauto.NewCounter(prometheus.CounterOpts{ Name: "dofus_requestsSearchTotal", Help: "The total number of searches on the global /search endpoint", }) RequestsItemsSearch = promauto.NewCounter(prometheus.CounterOpts{ Name: "dofus_requestsAllItemsSearch", Help: "The total number of searched items requests", }) RequestsMountsSearch = promauto.NewCounter(prometheus.CounterOpts{ Name: "dofus_requestsAllMountsSearch", Help: "The total number of searched mounts requests", }) RequestsSetsSearch = promauto.NewCounter(prometheus.CounterOpts{ Name: "dofus_requestsAllSetsSearch", Help: "The total number of searched sets requests", }) RequestsItemsList = promauto.NewCounter(prometheus.CounterOpts{ Name: "dofus_requestsAllItemsList", Help: "The total number of list items requests", }) RequestsMountsList = promauto.NewCounter(prometheus.CounterOpts{ Name: "dofus_requestsAllMountsList", Help: "The total number of list mounts requests", }) RequestsSetsList = promauto.NewCounter(prometheus.CounterOpts{ Name: "dofus_requestsAllSetsList", Help: "The total number list sets requests", }) RequestsItemsSingle = promauto.NewCounter(prometheus.CounterOpts{ Name: "dofus_requestsAllItemsSingle", Help: "The total number of single item requests", }) RequestsMountsSingle = promauto.NewCounter(prometheus.CounterOpts{ Name: "dofus_requestsAllMountsSingle", Help: "The total number of single mount requests", }) RequestsSetsSingle = promauto.NewCounter(prometheus.CounterOpts{ Name: "dofus_requestsAllSetsSingle", Help: "The total number of single set requests", }) RequestsAlmanaxSingle = promauto.NewCounter(prometheus.CounterOpts{ Name: "dofus_requestsAlmanaxSingle", Help: "The total number of single almanax requests", }) RequestsAlmanaxRange = promauto.NewCounter(prometheus.CounterOpts{ Name: "dofus_requestsAlmanaxRange", Help: "The total number of almanax range requests", }) )
Functions ¶
func CategoryIdApiMapping ¶
func CategoryIdMapping ¶
func DownloadExtract ¶
func DownloadImages ¶
func ExtractTarGz ¶
from Armatorix https://codereview.stackexchange.com/questions/272457/decompress-tar-gz-file-in-go
func LoadPersistedElements ¶
func LoadPersistedElements(elementsUrl string, typesUrl string) (PersistentStringKeysMap, PersistentStringKeysMap, error)
func NextRedBlueVersionStr ¶
func PartitionSlice ¶
func SetJsonHeader ¶
func SetJsonHeader(w *http.ResponseWriter)
func Values ¶
func Values[M ~map[K]V, K comparable, V any](m M) []V
https://stackoverflow.com/questions/13422578/in-go-how-to-get-a-slice-of-values-from-a-map
func WriteCacheHeader ¶
func WriteCacheHeader(w *http.ResponseWriter)
Types ¶
type GameVersion ¶
type Pagination ¶
func PageninationWithState ¶
func PageninationWithState(paginationStr string) Pagination
func (*Pagination) BuildLinks ¶
func (p *Pagination) BuildLinks(mainUrl url.URL, listSize int, apiScheme string, apiHostname string) (PaginationLinks, bool)
func (*Pagination) CalculateStartEndIndex ¶
func (p *Pagination) CalculateStartEndIndex(listSize int) (int, int)
func (*Pagination) ValidatePagination ¶
func (p *Pagination) ValidatePagination(listSize int) int
type PaginationLinks ¶
type PersistentStringKeysMap ¶
type PersistentStringKeysMap struct { Entries *treebidimap.Map `json:"entries"` NextId int `json:"next_id"` }
Click to show internal directories.
Click to hide internal directories.