utils

package
v0.0.0-...-8d78e55 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticateToken

func AuthenticateToken(token string) (map[string]interface{}, error)

func ComparePassword

func ComparePassword(hash *string, pass *string) error

func CreateToken

func CreateToken(email *string, name *string, id *string) string

func EncodeToBase64

func EncodeToBase64(f []byte) string

func ExistsBase64

func ExistsBase64(url string) (int, error)

func HashPassword

func HashPassword(pass *string) error

func IconRequest

func IconRequest(url string) (int, error)

func InsertBase64

func InsertBase64(base64 string, url string) (int, error)

func ResponseWriter

func ResponseWriter(statusCode int, message string, path *string, method *string, data interface{}) map[string]any

Types

type Icon

type Icon struct {
	Url   string `json:"url"`
	Icons []struct {
		Url     string `json:"url"`
		Width   int    `json:"width"`
		Height  int    `json:"height"`
		Format  string `json:"format"`
		Bytes   int    `json:"bytes"`
		Error   string `json:"error"`
		Sha1sum string `json:"sha1sum"`
	} `json:"icons"`
}

type UserClaims

type UserClaims struct {
	Email string `json:"email"`
	Name  string `json:"name"`
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL