u

package module
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 8, 2019 License: MIT Imports: 17 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 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 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 Green

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

func If

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

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 Magenta

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

func NewIntEncoder

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

func ReadFile added in v0.0.8

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

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 ShortUniqueId added in v0.0.10

func ShortUniqueId() string

func String

func String(value interface{}) string

func StringIf

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

func Strings

func Strings(value interface{}) []string

func Switch

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

func UniqueId

func UniqueId() 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