Documentation ¶
Index ¶
- Constants
- func Base64toJpg(data string) ([]byte, error)
- func Base64toMp3(data string) ([]byte, error)
- func Base64toPng(strcode string) ([]byte, error)
- func CheckFiltersLogGet(params []ParamsInfo, values map[string]interface{}) error
- func CheckFiltersLogPost(values map[string]interface{}) error
- func CheckHash(hash string) bool
- func CheckImage(data string) (err error)
- func DateToUnix(date string) int64
- func ExistUser(db *kaoriDatabase.NoSqlDb, email string) bool
- func FilterLog(rows []string, filter string, filterValue string) (r []string, err error)
- func GenerateID() string
- func GetCookies(r *http.Request, tokenIss, cookieKey string) (map[string]string, error)
- func GetIP(r *http.Request) string
- func GetParams(params []ParamsInfo, r *http.Request) (map[string]interface{}, error)
- func HasContentType(r *http.Request, mimetype string) bool
- func IsEmailValid(email string) bool
- func Ls(dir string) (files []string, err error)
- func ParseTemplate(tmpl string, data interface{}) (string, error)
- func ParseTemplateHtml(tmpl string, data interface{}) (string, error)
- func PasswordValid(pws string) error
- func PortValid(port string) error
- func PrintErr(w http.ResponseWriter, err string)
- func PrintInternalErr(w http.ResponseWriter)
- func PrintOk(w http.ResponseWriter)
- func SetCookies(w http.ResponseWriter, token, tokenIss, cookieKey string) error
- func UploadLittleBox(data []byte, nameFile string) (uri string, err error)
- func ValidateIdAnilist(ida int, tipo string) bool
- func VerifyAuth(db *kaoriDatabase.NoSqlDb, email, password string) (bool, error)
- type ParamsInfo
Constants ¶
View Source
const LittleBoxURI string = "https://litterbox.catbox.moe/resources/internals/api.php"
View Source
const UrlAnilist string = "https://anilist.co"
Variables ¶
This section is empty.
Functions ¶
func Base64toJpg ¶
Given a base64 string of a JPEG, encodes it into an JPEG image test.jpg
func Base64toMp3 ¶
func Base64toPng ¶
Converts pre-existing base64 data (found in example of https://golang.ir/pkg/image/#Decode) to test.png
func CheckFiltersLogGet ¶
func CheckFiltersLogGet(params []ParamsInfo, values map[string]interface{}) error
func CheckFiltersLogPost ¶
func CheckImage ¶
CheckImage controlla se è un'immagine e se è nei formati gestibili dal server
func DateToUnix ¶
func GenerateID ¶
func GenerateID() string
func GetCookies ¶
func GetParams ¶
func GetParams(params []ParamsInfo, r *http.Request) (map[string]interface{}, error)
getParams ritorna i parametri inviati tramite metodo GET dell'HTTP request.
func IsEmailValid ¶
func ParseTemplate ¶
func ParseTemplateHtml ¶
func PasswordValid ¶
func PrintErr ¶
func PrintErr(w http.ResponseWriter, err string)
printErr ritorna un errore al client impostando a 400 lo status code della risposta HTTP.
func PrintInternalErr ¶
func PrintInternalErr(w http.ResponseWriter)
printInternalErr imposta a 500 lo status code della risposta HTTP.
func PrintOk ¶
func PrintOk(w http.ResponseWriter)
printOk ritorna scrive al client uno status code 200 per indicare che va tutto bene.
func SetCookies ¶
func SetCookies(w http.ResponseWriter, token, tokenIss, cookieKey string) error
func ValidateIdAnilist ¶
validateIdAnilist convalida l'id anilist, ritorna true se è corretto altrimenti false.
func VerifyAuth ¶
func VerifyAuth(db *kaoriDatabase.NoSqlDb, email, password string) (bool, error)
Types ¶
type ParamsInfo ¶
Click to show internal directories.
Click to hide internal directories.