utils

package
v0.0.0-...-986a7cc Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2019 License: MIT Imports: 12 Imported by: 7

Documentation

Index

Constants

View Source
const (
	StatusNoError                 = 0
	StatusInvalid                 = 1
	StatusNameShort               = 2
	StatusPasswordShort           = 3
	StatusPasswordInvalid         = 4
	StatusNameInvalid             = 5
	StatusAddUserFailed           = 6
	StatusUserAlreadyExists       = 7
	StatusInvalidPassword         = 8
	StatusPasswordLong            = 9
	StatusNameLong                = 10
	StatusYoutubeFetchFailure     = 11
	StatusYoutubeSearchFailure    = 12
	StatusYoutubeGetFailure       = 13
	StatusYoutubeGetInfoFailure   = 14
	StatusYoutubeGetChartsFailure = 15
	StatusPlaylistIdAlreadyExists = 16
	StatusAddHistoryFailed        = 17
)
View Source
const (
	LOG_DIR       = "log"
	LOG_PREFIX    = "log"
	LOG_EXTENSION = ".txt"

	FILES       = "files"
	DATABASE    = FILES + "/sqldata"
	DATADB      = DATABASE + "/data.db"
	YOUTUBE_DIR = FILES + "/youtube"

	YOUTUBE_DL = "youtube-dl"
	FFMPEG     = "ffmpeg"
)

Variables

This section is empty.

Functions

func Decode

func Decode(text string) ([]byte, error)

func Decrypt

func Decrypt(key []byte, cryptoText string) (string, error)

func Encode

func Encode(text string) string

func Encrypt

func Encrypt(key []byte, text string) string

func ExecuteCmd

func ExecuteCmd(name string, arg ...string) (string, error)

func FileExists

func FileExists(file string) bool

func FormatMinutesSeconds

func FormatMinutesSeconds(minutes, seconds int) string

func FromURLBase64

func FromURLBase64(text string) ([]byte, error)

func GenerateRandom

func GenerateRandom(length int) []byte

func GetOutboundIP

func GetOutboundIP() net.IP

func InterfaceToString

func InterfaceToString(val interface{}) string

func MkDir

func MkDir(dir string) error

func Panic

func Panic(err error)

func ReverseStringSlice

func ReverseStringSlice(s []string)

func StringArrayContains

func StringArrayContains(array []string, item string) bool

func StringIsEmpty

func StringIsEmpty(data string) bool

func ToURLBase64

func ToURLBase64(buf []byte) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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