u

package module
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: May 19, 2019 License: MIT Imports: 19 Imported by: 91

README

utility

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalRand1 = rand.New(rand.NewSource(int64(time.Now().Nanosecond())))
View Source
var GlobalRand2 = rand.New(rand.NewSource(int64(time.Now().Unix())))

Functions

func AppendInt

func AppendInt(buf []byte, u uint64) []byte

func BBlack

func BBlack(s interface{}, attribs ...AttribCode) string

func BBlue

func BBlue(s interface{}, attribs ...AttribCode) string

func BCyan

func BCyan(s interface{}, attribs ...AttribCode) string

func BGreen

func BGreen(s interface{}, attribs ...AttribCode) string

func BMagenta

func BMagenta(s interface{}, attribs ...AttribCode) string

func BRed

func BRed(s interface{}, attribs ...AttribCode) string

func BWhite

func BWhite(s interface{}, attribs ...AttribCode) string

func BYellow

func BYellow(s interface{}, attribs ...AttribCode) string

func Black

func Black(s interface{}, attribs ...AttribCode) string

func Blue

func Blue(s interface{}, attribs ...AttribCode) string

func Bool

func Bool(value interface{}) bool

func Bytes

func Bytes(value interface{}) []byte

func CheckPath added in v0.0.8

func CheckPath(fileName string)

func Color

func Color(s interface{}, textColor TextColor, bgColor BgColor, attribs ...AttribCode) string

func Convert added in v0.1.9

func Convert(from, to interface{})

func Cyan

func Cyan(s interface{}, attribs ...AttribCode) string

func DecodeInt

func DecodeInt(buf []byte) uint64

func DecryptAes

func DecryptAes(crypted string, key []byte, iv []byte) string

func Dim added in v0.0.4

func Dim(s interface{}) string

func EncodeInt

func EncodeInt(u uint64) []byte

func EncryptAes

func EncryptAes(origData string, key []byte, iv []byte) string

func FileExists added in v0.0.8

func FileExists(fileName string) bool

func FinalType added in v0.1.9

func FinalType(v reflect.Value) reflect.Type

func FinalValue added in v0.1.9

func FinalValue(v reflect.Value) reflect.Value

func FixNilValue added in v0.1.9

func FixNilValue(v reflect.Value)

func FixUpperCase

func FixUpperCase(data []byte, excludesKeys []string)

func Float

func Float(value interface{}) float32

func Float64

func Float64(value interface{}) float64

func Floats

func Floats(value interface{}) []float64

func GetLowerName added in v0.1.9

func GetLowerName(s string) string

func GetUpperName added in v0.1.9

func GetUpperName(s string) string

func Green

func Green(s interface{}, attribs ...AttribCode) string

func If

func If(i bool, a, b interface{}) interface{}

func In added in v0.1.8

func In(arr []interface{}, s interface{}) bool

func Int

func Int(value interface{}) int

func Int64

func Int64(value interface{}) int64

func Ints

func Ints(value interface{}) []int64

func Italic added in v0.0.4

func Italic(s interface{}) string

func Json added in v0.1.6

func Json(value interface{}) string

func JsonP added in v0.1.6

func JsonP(value interface{}) string

func Load added in v0.0.8

func Load(fileName string, to interface{}) error

func LoadJson added in v0.1.13

func LoadJson(fileName string, to interface{}) error

func LoadYaml added in v0.1.13

func LoadYaml(fileName string, to interface{}) error

func Magenta

func Magenta(s interface{}, attribs ...AttribCode) string

func NewIntEncoder

func NewIntEncoder(digits string) (*intEncoder, error)

func ParseInt added in v0.1.9

func ParseInt(s string) int64

func ParseUint added in v0.1.9

func ParseUint(s string) uint64

func ReadFile added in v0.0.8

func ReadFile(fileName string) ([]string, error)

func ReadFullFile added in v0.1.13

func ReadFullFile(fileName string, maxLen uint) (string, error)

func RealValue added in v0.1.9

func RealValue(v reflect.Value) reflect.Value

func Red

func Red(s interface{}, attribs ...AttribCode) string

func RunCommand added in v0.0.8

func RunCommand(command string, args ...string) ([]string, error)

func Save added in v0.0.8

func Save(fileName string, data interface{}) error

func SaveJson added in v0.1.13

func SaveJson(fileName string, data interface{}) error

func SaveYaml added in v0.1.13

func SaveYaml(fileName string, data interface{}) error

func ShortUniqueId added in v0.0.10

func ShortUniqueId() string

func SplitTrim added in v0.1.12

func SplitTrim(s, sep string) []string

func String

func String(value interface{}) string

func StringIf

func StringIf(i bool, a, b string) string

func StringIn added in v0.1.8

func StringIn(arr []string, s string) bool

func Strings

func Strings(value interface{}) []string

func Switch

func Switch(i uint, args ...interface{}) interface{}

func Uint added in v0.1.9

func Uint(value interface{}) uint

func Uint64 added in v0.1.9

func Uint64(value interface{}) uint64

func UniqueId

func UniqueId() string

func ValueToString added in v0.1.10

func ValueToString(v reflect.Value) string

func White

func White(s interface{}, attribs ...AttribCode) string

func Yellow

func Yellow(s interface{}, attribs ...AttribCode) string

Types

type AttribCode

type AttribCode int
const (
	AttrNone AttribCode = iota
	AttrBold
	AttrDim
	AttrItalic
	AttrUnderline
	AttrBlink
	AttrFastBlink
	AttrReverse
	AttrHidden
	AttrCrossedOut
)

type BgColor

type BgColor int
const (
	BgBlack BgColor = iota + 40
	BgRed
	BgGreen
	BgYellow
	BgBlue
	BgMagenta
	BgCyan
	BgWhite
	BgNone BgColor = 0
)

type TextColor

type TextColor int
const (
	TextBlack TextColor = iota + 30
	TextRed
	TextGreen
	TextYellow
	TextBlue
	TextMagenta
	TextCyan
	TextWhite
	TextNone TextColor = 0
)

Jump to

Keyboard shortcuts

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