Documentation ¶
Overview ¶
Package utils provides some cross used information
Package utils provides some cross used information
Index ¶
- func ByteToMap(bytes []byte) (map[string]interface{}, error)
- func ByteToUint64(bytes []byte) uint64
- func Contains(list interface{}, elem interface{}) bool
- func DownloadFile(url, filepath string) error
- func ExtractGameID(fileName string) repository.GameID
- func GetIPFromRequest(r *http.Request) string
- func GetTitleMeta(titleID string) (string, bool, bool)
- func IsValidFilter(filter string) bool
- func Itob(v uint64) []byte
- func RemoveFileDesc(s []repository.FileDesc, index int) []repository.FileDesc
- func RemoveGameFile(s []repository.GameFileType, index int) []repository.GameFileType
- func Search(length int, f func(index int) bool) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteToUint64 ¶ added in v0.0.8
ByteToUint64 return an uint64 from bytes
func Contains ¶ added in v0.0.6
func Contains(list interface{}, elem interface{}) bool
Contains returns true if an element is present in a slice
func DownloadFile ¶
DownloadFile will download a url and store it in local filepath. It writes to the destination file as it downloads it, without loading the entire file into memory. We pass an io.TeeReader into Copy() to report progress on the download.
func ExtractGameID ¶
func ExtractGameID(fileName string) repository.GameID
ExtractGameID from fileName the id of game and version
func GetIPFromRequest ¶ added in v0.0.8
GetIPFromRequest returns ip from the request
func GetTitleMeta ¶ added in v0.2.1
GetTitleMeta returns the BaseID of the content, as well as Update / DLC flags
func IsValidFilter ¶ added in v0.0.6
IsValidFilter returns true if the filter is handled
func RemoveFileDesc ¶
func RemoveFileDesc(s []repository.FileDesc, index int) []repository.FileDesc
RemoveFileDesc remove a specific index inside a repository.FileDesc
func RemoveGameFile ¶
func RemoveGameFile(s []repository.GameFileType, index int) []repository.GameFileType
RemoveGameFile remove a specific index inside a repository.GameFileType
Types ¶
This section is empty.