utils

package
v0.0.0-...-0ddd045 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package utils provides small utility functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(p string) (string, error)

Abs returns the absolute path of p

func ConfigPath

func ConfigPath() (string, error)

func DecodeBase64

func DecodeBase64(input string, target interface{}) error

DecodeBase64 decodes a base64 'input' and unmarshals it into 'target'

func EncodeBase64

func EncodeBase64(input interface{}) (string, error)

EncodeBase64 encodes 'input' to base64 string

func Join

func Join(p ...string) string

Join joins the paths

func RandomByteSlice

func RandomByteSlice(n uint32) ([]byte, error)

RandomByteSlice returns a random byte slice with length n

func RandomCryptoString

func RandomCryptoString(n int) (string, error)

RandomCryptoString returns a cryptographically secure random string with length n

func RandomString

func RandomString(n int) (string, error)

RandomString returns a random string with length n

func ToNullTime

func ToNullTime(t time.Time) null.Time

ToNullTime returns t as nullable time

func UserHome

func UserHome() (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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