util

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TextBlack = iota + 30
	TextRed
	TextGreen
	TextYellow
	TextBlue
	TextMagenta
	TextCyan
	TextWhite
)

Variables

This section is empty.

Functions

func Black

func Black(str interface{}) string

func Blue

func Blue(str interface{}) string

func Cyan

func Cyan(str interface{}) string

func DelRepeat

func DelRepeat(str string, ch string) string

func FmtDate

func FmtDate(time time.Time, fmt string) string

func Green

func Green(str interface{}) string

func IfStr

func IfStr(ok bool, v1 string, v2 string) string

func InArrayInt

func InArrayInt(arr []int, ele int) bool

func InArrayString

func InArrayString(arr []string, ele string) bool

func IsWindows

func IsWindows() bool

func Magenta

func Magenta(str interface{}) string

func ParseUrlParam

func ParseUrlParam(url string) map[string]string

func ReadText

func ReadText(path string) (string, error)

func Red

func Red(str interface{}) string

func StartProxy

func StartProxy()

func Trim

func Trim(str string) string

func White

func White(str interface{}) string

func WriteText

func WriteText(text string, path string) error

func Yellow

func Yellow(str interface{}) string

Types

type JsonArray

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

func (*JsonArray) ForEach

func (obj *JsonArray) ForEach(fn func(int, *JsonObject))

func (*JsonArray) ForEachArray

func (obj *JsonArray) ForEachArray(fn func(int, *JsonArray))

func (*JsonArray) GetArray

func (obj *JsonArray) GetArray(i int) *JsonArray

func (*JsonArray) GetObject

func (obj *JsonArray) GetObject(i int) *JsonObject

func (*JsonArray) Length added in v1.0.2

func (obj *JsonArray) Length() int

type JsonObject

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

func NewJsonObject

func NewJsonObject(str string) *JsonObject

func (*JsonObject) Get

func (obj *JsonObject) Get(key string) interface{}

func (*JsonObject) GetArray

func (obj *JsonObject) GetArray(key string) *JsonArray

func (*JsonObject) GetObject

func (obj *JsonObject) GetObject(key string) *JsonObject

type JsonParser

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

func Json

func Json(m map[string]interface{}) *JsonParser

func (*JsonParser) Get

func (json *JsonParser) Get(key string) interface{}

type Stack

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

func (*Stack) Empty

func (s *Stack) Empty()

func (*Stack) IsEmpty

func (s *Stack) IsEmpty() bool

func (*Stack) Pop

func (s *Stack) Pop() string

func (*Stack) Push

func (s *Stack) Push(v string)

func (*Stack) Top

func (s *Stack) Top() string

Jump to

Keyboard shortcuts

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