util

package
v0.0.0-...-bf66d8f Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ErrorTabletopInvalidAction = "tabletop.invalid_action"

Errors

Variables

View Source
var Log = log.New(log.Writer(), "space-station ", log.Flags())
View Source
var Port int = 0
View Source
var UDPPort int = 0

Functions

func CompareHash

func CompareHash(h1, h2 []byte) bool

func DecryptAES

func DecryptAES(block cipher.Block, text []byte) ([]byte, error)

DecryptAES decryptes text with key using AES-256 GCM

func EncryptAES

func EncryptAES(block cipher.Block, text []byte) ([]byte, error)

EncryptAES encrypts text with key using AES-256 GCM

func FailedRequest

func FailedRequest(c *fiber.Ctx, error string, err error) error

func GenerateKey

func GenerateKey() ([]byte, error)

func GenerateToken

func GenerateToken(tkLength int32) string

func Hash

func Hash(bytes []byte) []byte

Hashes using SHA256

func InvalidRequest

func InvalidRequest(c *fiber.Ctx) error

func Node64

func Node64(id int64) string

func NodeTo64

func NodeTo64(id string) int64

func PostRaw

func PostRaw(url string, body map[string]interface{}) (map[string]interface{}, error)

func PostRequest

func PostRequest(url string, body map[string]interface{}) (map[string]interface{}, error)

func SuccessfulRequest

func SuccessfulRequest(c *fiber.Ctx) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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