utils

package
v0.1.0-nightly Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DataDir string
View Source
var ECDSAPrivateKey *ecdsa.PrivateKey
View Source
var EdDSAPrivateKey ed25519.PrivateKey
View Source
var (
	LibraVersion, _ = types.ParseVersion(rawVersion)
)
View Source
var RSAPrivateKey *rsa.PrivateKey

Functions

func ComparePassword

func ComparePassword(hashedPassword string, password string) bool

func DownloadFile

func DownloadFile(url string) ([]byte, error)

func DownloadFileTo

func DownloadFileTo(url string, path string) error

func ExecCommand

func ExecCommand(command []string) ([]byte, error)

func GenerateID

func GenerateID(length int) string

func GeneratePassword

func GeneratePassword(p string) string

func GenerateToken

func GenerateToken(id string, expiration time.Duration, signingMethod string, signingKey string) (string, error)

func GetCorrectSigningMethod

func GetCorrectSigningMethod(signingMethod string) string

func GetVersionInfo

func GetVersionInfo() string

func HasSupportedScheme

func HasSupportedScheme(urlStr string) bool

func IsValidSourceURL

func IsValidSourceURL(urlStr string) bool

func LoadPrivateKey

func LoadPrivateKey(signingMethod string, signingKey string) error

func ParseDuration

func ParseDuration(s string) (time.Duration, error)

ParseDuration parses a duration string. examples: "10d", "-1.5w" or "3Y4M5d". Add time units are "d"="D", "w"="W".

func ParseHumanDuration

func ParseHumanDuration(durationStr string) (time.Duration, error)

func SetupLogger

func SetupLogger(logFormat string, logLevel log.Level)

Types

This section is empty.

Jump to

Keyboard shortcuts

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