Documentation
¶
Index ¶
- func ArrayInterfaceContains(arr []interface{}, str string) bool
- func ArrayStringContains(arr []string, str string) bool
- func CompareArgon2id(inputPassword, salt, storedHash string) bool
- func ComparePassword(hashedPassword, password string) bool
- func DecryptAES256CBC(encrypted *EncryptedData, key []byte) (string, error)
- func DiscordLogger(logTypeParam, titleParam, messageParam, serviceParam string, ...)
- func GenerateHMAC(iv, ciphertext, key []byte) []byte
- func GenerateHS256Token(secret, key, userID string, data interface{}, duration time.Time) string
- func GenerateIV() ([]byte, error)
- func GenerateRS512Token(privateKey, key, userID string, data interface{}, duration time.Time) string
- func HashArgon2id(password, salt string) string
- func InitApp() error
- func IsUUID(uuid string) bool
- func IsValidDeviceCategory(deviceCategory string) bool
- func IsValidDeviceType(deviceType string) bool
- func JSONMarshal(data interface{}) string
- func JSONPrettyLog(v interface{})
- func JSONUnmarshal(data []byte, v interface{}) error
- func PKCS7Pad(data []byte, blockSize int) []byte
- func PKCS7Unpad(data []byte) ([]byte, error)
- func RandomInt(min int, max int) int
- func RandomString(length int) string
- func SendResponse(baseResponse ResponseStruct) (err error)
- func Validate(body reflect.Type, errors error) interface{}
- func ValidateHS256Token(secret, token string) (*jwt.Token, error)
- func ValidateRS512Token(publicKey, token string) (*jwt.Token, error)
- func VerifyHMAC(iv, ciphertext, key []byte, mac string) bool
- type BaseResponse
- type EncryptedData
- type JwtAuthClaim
- type JwtAuthClaimTeamSub
- type JwtRememberClaim
- type ResponseStruct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArrayInterfaceContains ¶
func ArrayStringContains ¶
func CompareArgon2id ¶
func ComparePassword ¶
func DecryptAES256CBC ¶
func DecryptAES256CBC(encrypted *EncryptedData, key []byte) (string, error)
func DiscordLogger ¶
func GenerateHMAC ¶
func GenerateHS256Token ¶
func GenerateIV ¶
func GenerateRS512Token ¶
func HashArgon2id ¶
func IsValidDeviceCategory ¶
func IsValidDeviceType ¶
func JSONMarshal ¶
func JSONMarshal(data interface{}) string
func JSONPrettyLog ¶
func JSONPrettyLog(v interface{})
func JSONUnmarshal ¶
func PKCS7Unpad ¶
func RandomString ¶
func SendResponse ¶
func SendResponse(baseResponse ResponseStruct) (err error)
func ValidateHS256Token ¶
func ValidateRS512Token ¶
func VerifyHMAC ¶
Types ¶
type BaseResponse ¶
type EncryptedData ¶
type EncryptedData struct { IV string `json:"iv"` Value string `json:"value"` MAC string `json:"mac"` Tag string `json:"tag"` }
func EncryptAES256CBC ¶
func EncryptAES256CBC(plaintext, key []byte) (*EncryptedData, error)
type JwtAuthClaim ¶
type JwtAuthClaim struct { TeamSub []JwtAuthClaimTeamSub `json:"team_sub"` Roles []string `json:"roles"` Permissions []string `json:"permissions"` }
type JwtAuthClaimTeamSub ¶
type JwtRememberClaim ¶
type JwtRememberClaim struct {
RememberToken string `json:"remember_token"`
}
type ResponseStruct ¶
Click to show internal directories.
Click to hide internal directories.