utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bcrypt

func Bcrypt(password string) (string, error)

Bcrypt hashes a string

func GenerateRandomString

func GenerateRandomString(length int) string

GenerateRandomString generates a random string of a given length using the characters provided.

func PkgName

func PkgName(v interface{}) string

func PrettyPrint

func PrettyPrint(data map[string]interface{}) (string, error)

PrettyPrint converts a map to a pretty-printed JSON string

func StructToMap

func StructToMap(obj interface{}) (map[string]interface{}, error)

StructToMap converts any struct to map[string]interface{}

Types

type Pkg

type Pkg struct {
	// contains filtered or unexported fields
}

func NewPkg

func NewPkg(packageName string) *Pkg

func (*Pkg) HasFunction

func (p *Pkg) HasFunction(funcName string) bool

Jump to

Keyboard shortcuts

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