cast

package
v0.0.0-...-7c1eb0e Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 16 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes2String

func Bytes2String(b []byte) string

func BytesToString

func BytesToString(b []byte) string

func ConvertAssign

func ConvertAssign(dest, src interface{}) error

func FloatToStr

func FloatToStr(f float64, precise ...int) string

func FormatFloat

func FormatFloat(f float64, precise ...int) string

func FormatFloat32

func FormatFloat32(f float32, precise ...int) string

func FromUTF8

func FromUTF8(sourceString string, charset string) string

func GbkToUtf8

func GbkToUtf8(bs []byte) ([]byte, error)

func GetSysTimeLayout

func GetSysTimeLayout() string

func MapStringToValue

func MapStringToValue[T any](m map[string]interface{}, key string) T

func String2Bytes

func String2Bytes(s string) []byte

func StringToBytes

func StringToBytes(s string) []byte

func ToBool

func ToBool(v interface{}, defaultValue ...bool) (bool, error)

func ToBoolValue

func ToBoolValue(v interface{}, defaultValue ...bool) bool

func ToFloat32

func ToFloat32(v interface{}, defaultValue ...float32) (float32, error)

func ToFloat32Value

func ToFloat32Value(v interface{}, defaultValue ...float32) float32

func ToFloat64

func ToFloat64(v interface{}, defaultValue ...float64) (float64, error)

func ToFloat64Value

func ToFloat64Value(v interface{}, defaultValue ...float64) float64

func ToInt

func ToInt(v interface{}, defaultValue ...int) (int, error)

func ToInt64

func ToInt64(v interface{}, defaultValue ...int64) (int64, error)

func ToInt64Value

func ToInt64Value(v interface{}, defaultValue ...int64) int64

func ToIntValue

func ToIntValue(v interface{}, defaultValue ...int) int

func ToMapStringInterface

func ToMapStringInterface(v interface{}) (map[string]interface{}, bool)

func ToString

func ToString(v interface{}, defaultValue ...string) (string, error)

func ToStringValue

func ToStringValue(v interface{}, defaultValue ...string) string

func ToUTF8

func ToUTF8(sourceString string, charset string) string

func U16ToU8

func U16ToU8(data []byte) ([]byte, error)

func U8ToU16

func U8ToU16(data []byte, bigEndian bool) ([]byte, error)

func UnicodeStringToUtf8

func UnicodeStringToUtf8(raw string) (string, error)

func UnicodeToString

func UnicodeToString(data []byte) string

func UnicodeToUtf8

func UnicodeToUtf8(u16 []byte) string

func Utf8ToGbk

func Utf8ToGbk(bs []byte) ([]byte, error)

Types

type Bool

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

////////////////////////////Bool////////////////////////////

func (*Bool) Get

func (me *Bool) Get() bool

func (*Bool) Set

func (me *Bool) Set(v bool) bool

type Int

type Int int32

////////////////////////////int32////////////////////////////

func (*Int) Add

func (me *Int) Add(v int32) int32

func (*Int) Dec

func (me *Int) Dec() int32

func (*Int) Get

func (me *Int) Get() int32

func (*Int) Inc

func (me *Int) Inc() int32

func (*Int) Set

func (me *Int) Set(v int32) int32

func (*Int) ToString

func (me *Int) ToString() string

type Int64

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

////////////////////////////int64////////////////////////////

func (*Int64) Add

func (me *Int64) Add(v int64) int64

func (*Int64) Dec

func (me *Int64) Dec() int64

func (*Int64) Get

func (me *Int64) Get() int64

func (*Int64) Inc

func (me *Int64) Inc() int64

func (*Int64) Set

func (me *Int64) Set(v int64) int64

func (*Int64) Sub

func (me *Int64) Sub(v int64) int64

func (*Int64) ToString

func (me *Int64) ToString() string

type RawBytes

type RawBytes []byte

Jump to

Keyboard shortcuts

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