common

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: GPL-3.0 Imports: 9 Imported by: 30

Documentation

Index

Constants

View Source
const (
	KiB = 1024
	MiB = KiB * 1024
	GiB = MiB * 1024
)
View Source
const (
	Version = "v0.1.2"
)

Variables

This section is empty.

Functions

func ConnectDatabase added in v0.0.3

func ConnectDatabase(driverName, username, password, ip string, port int, dbName string) (*sql.DB, error)

func GetProgramDir added in v0.1.0

func GetProgramDir() string

func HumanFriendlyTraffic

func HumanFriendlyTraffic(bytes int) string

func Must

func Must(err error)

func NewBufReadWriter added in v0.0.2

func NewBufReadWriter(rw io.ReadWriter) *bufio.ReadWriter

func RegisterOptionHandler added in v0.0.15

func RegisterOptionHandler(h OptionHandler)

func SHA224String

func SHA224String(password string) string

Types

type Error

type Error struct {
	// contains filtered or unexported fields
}

func NewError

func NewError(info string) *Error

func (*Error) Base

func (e *Error) Base(err error) *Error

func (*Error) Error

func (e *Error) Error() string

type OptionHandler added in v0.0.15

type OptionHandler interface {
	Name() string
	Handle() error
	Priority() int
}

func PopOptionHandler added in v0.0.15

func PopOptionHandler() (OptionHandler, error)

type Runnable

type Runnable interface {
	Run() error
	Close() error
}

Jump to

Keyboard shortcuts

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