common

package module
v0.0.0-...-34b89f8 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: Apache-2.0 Imports: 13 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BcryptHash

func BcryptHash(password []byte) []byte

func Bool

func Bool(i bool) *bool

func CheckErr

func CheckErr(err error)

func Duration

func Duration(i time.Duration) *time.Duration

func ExitIfError

func ExitIfError(msg string, err error)

func GetBufferSize

func GetBufferSize(fileSize int64) int

func GetFileChecksum

func GetFileChecksum(file *os.File) string

func GetFileSize

func GetFileSize(file *os.File) int64

func GetUserInput

func GetUserInput(label string) string

func GetUserPasswordInput

func GetUserPasswordInput() string

func Int

func Int(i int) *int

func Int64

func Int64(i int64) *int64

func IsFileExist

func IsFileExist(filename string) bool

func Md5Pass

func Md5Pass(password string) []byte

Md5Pass calculate password hash 1. reverse the password, ie: admin -> nimda 2. split the reverse password into array 3. join the array with comma as a string, ie: n,i,m,d,a 4. calculate md5 checksum of the result string

func Md5sum

func Md5sum(password []byte) []byte

func MustGetBool

func MustGetBool(flags *pflag.FlagSet, flag string) bool

func MustGetString

func MustGetString(flags *pflag.FlagSet, flag string) string

func MustGetUint

func MustGetUint(flags *pflag.FlagSet, flag string) uint

func Reverse

func Reverse(str string) []byte

func String

func String(i string) *string

func Strings

func Strings(ss []string) []*string

Types

type StrSlice

type StrSlice []string

func (StrSlice) Has

func (list StrSlice) Has(s string) bool

Jump to

Keyboard shortcuts

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