xstring

package
v0.3.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OmitDefaultAPI = jsoniter.Config{
	SortMapKeys:            true,
	UseNumber:              true,
	CaseSensitive:          true,
	EscapeHTML:             true,
	ValidateJsonRawMessage: true,
}.Froze()

OmitDefaultAPI ...

Functions

func Addr2Hex

func Addr2Hex(str string) (string, error)

Addr2Hex converts address string to hex string, only support ipv4.

func AnyBlank

func AnyBlank(ss []string) bool

AnyBlank return true if ss has empty element

func CallerName

func CallerName(skip int) string

CallerName ...

func FunctionName

func FunctionName(i interface{}) string

FunctionName ...

func GenerateID

func GenerateID() string

GenerateID simply generates an ID.

func GenerateUUID

func GenerateUUID(seedTime time.Time) string

GenerateUUID simply generates an unique UID.

func Hex2Addr

func Hex2Addr(str string) (string, error)

Hex2Addr converts hex string to address.

func Json

func Json(obj interface{}) string

Json ...

func JsonBytes

func JsonBytes(obj interface{}) []byte

JsonBytes ...

func ObjectName

func ObjectName(i interface{}) string

ObjectName ...

func PrettyJSONBytes

func PrettyJSONBytes(obj interface{}) []byte

PrettyJSONBytes ...

func PrettyJson

func PrettyJson(obj interface{}) string

PrettyJson ...

func ToCamelCase

func ToCamelCase(str string) string

ToCamelCase 转为驼峰格式

func ToSnakeCase

func ToSnakeCase(str string) string

ToSnakeCase 转为snake格式

Types

type Formatter

type Formatter string

Formatter ...

func (Formatter) Format

func (fm Formatter) Format(args ...interface{}) string

Format ...

type Strings

type Strings []string

Strings ...

func KickEmpty

func KickEmpty(ss []string) Strings

KickEmpty kick empty elements from ss

func Split

func Split(raw string, sep string) Strings

Split ...

func (Strings) Head

func (ss Strings) Head() string

Head ...

func (Strings) Head2

func (ss Strings) Head2() (h0, h1 string)

Head2 ...

func (Strings) Head3

func (ss Strings) Head3() (h0, h1, h2 string)

Head3 ...

func (Strings) Head4

func (ss Strings) Head4() (h0, h1, h2, h3 string)

Head4 ...

func (Strings) HeadT

func (ss Strings) HeadT() (string, Strings)

HeadT ...

Jump to

Keyboard shortcuts

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