baseutils

package
v0.0.0-...-6b9be9b Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: MulanPSL-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func Any2Int64

func Any2Int64(value interface{}) int64

func Any2Str

func Any2Str(value interface{}) string

func Autowired

func Autowired(some any) error

func CheckCrc

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

Modbus协议Crc校验

func CheckType

func CheckType(i interface{}) string

func ContainsStru

func ContainsStru[T any](someStru interface{}) bool

func ContainsStruPtr

func ContainsStruPtr(someStru, childStru any) bool
func ContainsGometa(some interface{}) bool {
	return ContainsStru[basedto.Gometa](some)

}

func DesDec

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

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

func DesEnc

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

func FieldsFunc

func FieldsFunc(fieldsName string) []string

func FindNameOfIface

func FindNameOfIface(iface any) string

func FindPkgNameOfIface

func FindPkgNameOfIface(iface any) string

func FindStruNilPtrFields

func FindStruNilPtrFields(Stru any) []reflect.StructField

func FindStructFields

func FindStructFields(v any) []reflect.StructField

func FmtPrintLn

func FmtPrintLn(a ...interface{})

func FormatDatetime

func FormatDatetime(t time.Time) string

func FormatNow

func FormatNow() string

func GetAllFields

func GetAllFields(i any) []string

func GetBool

func GetBool(v bool) *bool

func GetBool2Ptr

func GetBool2Ptr(v bool) *bool

func GetBoolPtr

func GetBoolPtr(v bool) *bool

func GetInt

func GetInt(v int) *int

func GetInt8

func GetInt8(v int8) *int8

func GetInt16

func GetInt16(v int16) *int16

func GetInt32

func GetInt32(v int32) *int32

func GetInt32Ptr

func GetInt32Ptr(v int32) *int32

func GetInt64

func GetInt64(v int64) *int64

func GetInt64Ptr

func GetInt64Ptr(v int64) *int64

func GetPtr2Int32

func GetPtr2Int32(v *int32) int32

func GetPtr2Int64

func GetPtr2Int64(v *int64) int64

func GetPtr2Str

func GetPtr2Str(v *string) string

func GetString

func GetString(v string) *string

func GetStringPtr

func GetStringPtr(v string) *string

func GetTime

func GetTime(v time.Time) *time.Time

func GetTimeNow

func GetTimeNow() int64

获取时间

func IfBaseModel

func IfBaseModel(some any) (baseiface.IbaseModel, bool)

func IfIface

func IfIface[T any](some any) bool

func IfInterface

func IfInterface[T any](some any) (T, bool)

func IfLinux

func IfLinux() bool

func IfNilPtrChild

func IfNilPtrChild(Stru any, feild string) bool

func IfProxy

func IfProxy(some any) bool

func IfProxyInitProxy

func IfProxyInitProxy(some any) bool

func IfPtr

func IfPtr(v any) bool

func IfPtrNil

func IfPtrNil(v any) bool

func IfStru

func IfStru(value any) bool

func IfTypeStru

func IfTypeStru(v reflect.Type) bool

func IfValueStru

func IfValueStru(v reflect.Value) bool

func IfWindows

func IfWindows() bool

func InitStruNilPtrFields

func InitStruNilPtrFields(Stru any)

func IsStru

func IsStru(t reflect.Type) (reflect.Type, bool)

func IsStruTime

func IsStruTime(t reflect.Type) bool

func LoadBeanProxy

func LoadBeanProxy[T baseiface.IbaseProxy]() T

func LoadIniCfg

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

func MakeUnique

func MakeUnique(arr []int64) []int64

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 interface{}) string

func NewIchubLog

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

func NewOfPtrSome

func NewOfPtrSome(some any) any

func NewOfPtrType

func NewOfPtrType[T baseiface.IpoolObj]() T

T is *type

func NewOfPtrTypeAny

func NewOfPtrTypeAny[T any]() T

func NewOfPtrTypeProxy

func NewOfPtrTypeProxy[T baseiface.IbaseProxy]() T

func NewOfType

func NewOfType[T baseiface.IpoolObj]() T

no used

func NewProxyTypeOf

func NewProxyTypeOf(t reflect.Type) (baseiface.IbaseProxy, bool)

func NewSliceOfAny

func NewSliceOfAny(some any, len int) any

func NewStru

func NewStru[S any]() *S

func NewStruProxy

func NewStruProxy[S baseiface.IbaseProxy]() S

func NotStruTime

func NotStruTime(t reflect.Type) (reflect.Type, bool)

func PtrInt32ToString

func PtrInt32ToString(v *int32) string

func PtrInt64ToString

func PtrInt64ToString(v *int64) string

func PtrIntToString

func PtrIntToString(v *int) string

func Round

func Round(f float64, n int) float64

func SetFieldValue

func SetFieldValue(refValue reflect.Value, value any)

func SetFieldValues

func SetFieldValues(refValue reflect.Value, value any)

func SnowflakeNextVal

func SnowflakeNextVal() int64

func SnowflakeNextValStr

func SnowflakeNextValStr() string

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 ToStruMap

func ToStruMap(src any, out any)

func UniqueId

func UniqueId() string

func Uuid

func Uuid() string

func UuidSimple

func UuidSimple() string

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) Int8

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

Int8 string to int8

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) 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) Uint8

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

Uint8 string to uint8

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

type StruValue

type StruValue struct {
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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