util

package
v0.0.0-...-17871bd Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLockedFile

func CreateLockedFile(path string) error

func Date

func Date() string

func EmailSuffix

func EmailSuffix(email string) string

func Expiry

func Expiry(expiry int64) int64

func GenFileName

func GenFileName(fileNameParts ...string) string

func GenFilePath

func GenFilePath(dir, fileName string) string

func IsFileNotExist

func IsFileNotExist(file string) bool

func IsNotDir

func IsNotDir(dir string) bool

func LoadFromYaml

func LoadFromYaml(path string, cfg interface{}) error

func Lock

func Lock(path string) (func(), error)

func Md5sumOfBytes

func Md5sumOfBytes(data *[]byte) string

func Md5sumOfFile

func Md5sumOfFile(path string) (string, error)

func NewTemplate

func NewTemplate(name, path string) (*template.Template, error)

func Now

func Now() int64

func RandStr

func RandStr(strSize int, randType string) string

func RenderTemplate

func RenderTemplate(tmpl *template.Template, data interface{}) (string, error)

func WithFileLock

func WithFileLock(path string, handle func() error) error

Types

type SymmetricEncryption

type SymmetricEncryption interface {
	Encrypt(plaintext []byte) ([]byte, error)
	Decrypt(ciphertext []byte) ([]byte, error)
}

func NewSymmetricEncryption

func NewSymmetricEncryption(key, nonce string) (SymmetricEncryption, error)

Jump to

Keyboard shortcuts

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