utils

package
v0.0.7-alpha Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckHash

func CheckHash(input, hash string) error

func Decrypt

func Decrypt(encryptedString string, keys ...string) (string, error)

func Encrypt

func Encrypt(stringToEncrypt string, keys ...string) (string, error)

func ExtractContent

func ExtractContent(content string) (string, string)

func FirstError

func FirstError(errors ...error) error

FirstError return the first error in a list of errors

func GenerateHash

func GenerateHash(input string) (string, error)

func GetFunctionName

func GetFunctionName(i interface{}) string

func GetStructField

func GetStructField(entity interface{}, field string) reflect.Value

GetStructField returns the value of a struct field

func MarkdownToHtml

func MarkdownToHtml(content string) (string, error)

func Repeat

func Repeat[T comparable](input T, time int) []T

func SanitizeMarkdown

func SanitizeMarkdown(html string) string

func SanitizePlainText

func SanitizePlainText(html string) string

func SliceAppendIfNotExists

func SliceAppendIfNotExists[T comparable](slice []T, newItem T, checkExists func(T) bool) []T

func SliceContains

func SliceContains[T comparable](slice []T, element T) bool

func SliceFilter

func SliceFilter[T comparable](slice []T, predicate func(T) bool) []T

func SliceMap

func SliceMap[T comparable, R comparable](slice []T, mapper func(T) R) []R

func SliceOverlap

func SliceOverlap[T comparable](slice1 []T, slice2 []T) []T

func Url

func Url(path string) string

Types

type HashConfig

type HashConfig struct {
	Iterations uint32
	Memory     uint32
	KeyLen     uint32
	Threads    uint8
}

Jump to

Keyboard shortcuts

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