utils

package
v0.0.0-...-de8f1eb Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInteractionNotFound = errors.New("interaction_not_found")
	//ErrFoundTooMany        = errors.New("found_too_many")
	ErrStructMismatch = errors.New("struct_mismatch")
	ErrRoleNotFound   = errors.New("role_not_found")
)
View Source
var (
	FlagAdminPassword  = os.Getenv("ADMIN_PASSWORD")
	FlagDiscordGuild   = os.Getenv("DISCORD_GUILD")
	FlagDiscordToken   = os.Getenv("DISCORD_TOKEN")
	FlagSecretPassword = os.Getenv("SECRET")
)

Functions

func CastAndCompare

func CastAndCompare[T any](rawMessage any) (T, bool)

func CompareJSONToStruct

func CompareJSONToStruct(mapped map[string]interface{}, Struct any) (retVal bool)

func HashMD5

func HashMD5(text string) string

func Logger

func Logger() *logrus.Logger

func MapToStruct

func MapToStruct(mapped map[string]any, Struct any)

func ReadRequestBodyMap

func ReadRequestBodyMap[T1 comparable, T2 any](body io.ReadCloser) (map[T1]T2, error)

func SortedMapKeys

func SortedMapKeys[T any](mapped map[string]T) []string

Types

This section is empty.

Jump to

Keyboard shortcuts

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