kstring

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 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 KVInt

func KVInt(key string, value int) string

func KVInt32

func KVInt32(key string, value int32) string

func KVInt64

func KVInt64(key string, value int64) string

func KVInterface

func KVInterface(key string, value interface{}) string

func KVString

func KVString(key string, value string) string

func KVTime

func KVTime(key string, value time.Time) string

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 SugarFormat

func SugarFormat(vals ...interface{}) string

func Title

func Title(title string) string

func ToCacheKey

func ToCacheKey(prefix, s1 string, s ...string) string

func ToCamelCase

func ToCamelCase(s string) string

ToCamelCase the given string in camelcase format.

func ToLowerFirstCamelCase

func ToLowerFirstCamelCase(s string) string

ToLowerFirstCamelCase returns the given string in camelcase formatted string but with the first letter being lowercase.

func ToLowerSnakeCase

func ToLowerSnakeCase(s string) string

ToLowerSnakeCase the given string in snake-case format.

func ToUpperFirst

func ToUpperFirst(s string) string

ToUpperFirst returns the given string with the first letter being uppercase.

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