utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogLevelInfo  = "INFO"
	LogLevelError = "ERROR"
	LogLevelDebug = "DEBUG"
)

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(encodedPlaintext string, privateKey string) (string, error)

func Encrypt

func Encrypt(plaintext string, privateKey string) string

func FormatJSON

func FormatJSON(jsonString string) string

func GetTimeWindow

func GetTimeWindow(window string) (int, time.Duration)

func IsJsonValid

func IsJsonValid(jsonString string, obj interface{}) bool

func Log

func Log(logLevel string, message string, args ...interface{})

func LogDebug

func LogDebug(message string, args ...interface{})

func LogError

func LogError(message string, args ...interface{})

func LogInfo

func LogInfo(message string, args ...interface{})

func ReadJsonFromFile

func ReadJsonFromFile(path string) string

func ResponseJSON

func ResponseJSON(w http.ResponseWriter, data interface{}, status int)

func ToJsonFromObject

func ToJsonFromObject(object interface{}) string

func ToMapFromObject

func ToMapFromObject(obj interface{}) map[string]interface{}

Types

This section is empty.

Jump to

Keyboard shortcuts

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