baseutils

package
v1.4.131 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MulanPSL-2.0 Imports: 25 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MbTable = []uint16{}/* 256 elements not displayed */

Functions

func Any2Str

func Any2Str(value interface{}) string

func CheckCrc

func CheckCrc(cmd []byte, data []byte, pos int, dlen int) bool

Modbus协议Crc校验

func CheckType

func CheckType(i interface{}) string

func ContainsType added in v1.3.5

func ContainsType(s interface{}, name string) bool

func ContainsTypeOfSub added in v1.3.7

func ContainsTypeOfSub(s interface{}, name string) bool

func DesDec added in v1.3.13

func DesDec(c []byte, key []byte) ([]byte, error)

.. var tt, rrr = gdes.DecryptECB(r, []byte("12345678"), gdes.PKCS5PADDING)

func DesEnc added in v1.3.13

func DesEnc(c []byte, key []byte) ([]byte, error)

func FindNameOfIface added in v1.4.100

func FindNameOfIface(iface any) string

func FmtPrintLn

func FmtPrintLn(a ...any)

func FormatDatetime

func FormatDatetime(t time.Time) string

func FormatNow

func FormatNow() string

func GetTime

func GetTime() int64

获取时间

func IfBaseEntity added in v1.3.7

func IfBaseEntity(Some any) bool

func IfIface added in v1.3.5

func IfIface[T any](inst any) bool

check inst impl interface T

func IfProxy added in v1.4.120

func IfProxy(some any) bool

func LoadIniCfg

func LoadIniCfg(fileName string) (*ini.File, error)

func Map2Str

func Map2Str(mapkey map[string]interface{}) strings.Builder

func MapKey2Str

func MapKey2Str(mapkey map[string]interface{}) strings.Builder

func ModbusCrcCheckSum

func ModbusCrcCheckSum(data []byte) []byte

func NameOfType

func NameOfType(v any) string

func NewIchubLog

func NewIchubLog(filename string) (logger *log.Logger)

func NewIchubLogger

func NewIchubLogger(pathfile string) *log.Logger

func NewOfPtrType added in v1.4.126

func NewOfPtrType[T baseiface.IpoolObj]() T

T is *type

func NewOfType added in v1.4.126

func NewOfType[T baseiface.IpoolObj]() T

func Nipv4 added in v1.2.1

func Nipv4() string

https://www.jianshu.com/p/982c4fabb11d swagg参数

func Round

func Round(f float64, n int) float64

func SetFieldValue

func SetFieldValue(val reflect.Value, value interface{})

func SnowflakeNextVal

func SnowflakeNextVal() int64

func ToInt32

func ToInt32(value interface{}) (d int32)

func ToInt64

func ToInt64(value interface{}) (d int64)

ToInt64 interface to int64

func ToStr

func ToStr(value interface{}, args ...int) (s string)

ToStr interface to string

func UniqueId

func UniqueId() string

func Uuid

func Uuid() string

获取uuid

Types

type StrTo

type StrTo string

StrTo is the target string

func (StrTo) Bool

func (f StrTo) Bool() (bool, error)

Bool string to bool

func (*StrTo) Clear

func (f *StrTo) Clear()

Clear string

func (StrTo) Exist

func (f StrTo) Exist() bool

Exist check string exist

func (StrTo) Float32

func (f StrTo) Float32() (float32, error)

Float32 string to float32

func (StrTo) Float64

func (f StrTo) Float64() (float64, error)

Float64 string to float64

func (StrTo) Int

func (f StrTo) Int() (int, error)

Int string to int

func (StrTo) Int16

func (f StrTo) Int16() (int16, error)

Int16 string to int16

func (StrTo) Int32

func (f StrTo) Int32() (int32, error)

Int32 string to int32

func (StrTo) Int64

func (f StrTo) Int64() (int64, error)

Int64 string to int64

func (StrTo) Int8

func (f StrTo) Int8() (int8, error)

Int8 string to int8

func (*StrTo) Set

func (f *StrTo) Set(v string)

Set string

func (StrTo) String

func (f StrTo) String() string

String string to string

func (StrTo) Uint

func (f StrTo) Uint() (uint, error)

Uint string to uint

func (StrTo) Uint16

func (f StrTo) Uint16() (uint16, error)

Uint16 string to uint16

func (StrTo) Uint32

func (f StrTo) Uint32() (uint32, error)

Uint32 string to uint31

func (StrTo) Uint64

func (f StrTo) Uint64() (uint64, error)

Uint64 string to uint64

func (StrTo) Uint8

func (f StrTo) Uint8() (uint8, error)

Uint8 string to uint8

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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