utils

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: AGPL-3.0 Imports: 26 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile added in v0.0.5

func CopyFile(src, dst string) (int64, error)

func FilePathExists

func FilePathExists(path string) bool

func GetFileModifyTime added in v0.0.4

func GetFileModifyTime(fileName string) int64

func GetFileSize added in v0.0.5

func GetFileSize(fileName string) int64

func GetFloat32Param

func GetFloat32Param(param map[string]string, key string, defaultVal float32) float32

func GetFloat64Param

func GetFloat64Param(param map[string]string, key string, defaultVal float64) float64

func GetInt32Param

func GetInt32Param(param map[string]string, key string, defaultVal int32) int32

func GetInt64Param

func GetInt64Param(param map[string]string, key string, defaultVal int64) int64

func GetInt8Param

func GetInt8Param(param map[string]string, key string, defaultVal int8) int8

func GetIntParam

func GetIntParam(param map[string]string, key string, defaultVal int) int

func GetLocalIp added in v0.0.16

func GetLocalIp() (string, error)

func GetMD5 added in v0.0.7

func GetMD5(filepath string) string

func GetStringParam added in v0.0.6

func GetStringParam(param map[string]string, key string, defaultVal string) string

func GetUInt32Param

func GetUInt32Param(param map[string]string, key string, defaultVal uint32) uint32

func GetUInt64Param

func GetUInt64Param(param map[string]string, key string, defaultVal uint64) uint64

func Int2String

func Int2String(v int) string

func Int322String added in v0.0.18

func Int322String(v int32) string

func Int642String added in v0.0.18

func Int642String(v int64) string

func ListDir added in v0.0.5

func ListDir(dir string) ([]string, error)

func NewKratosGrpcConn added in v0.0.17

func NewKratosGrpcConn(rdConf commonconfig.RegisterDiscoveryConfig) (*grpc.ClientConn, error)

func NewKratosHttpConn added in v0.0.17

func NewKratosHttpConn(rdConf commonconfig.RegisterDiscoveryConfig) (*khttp.Client, error)

func String2Float32

func String2Float32(s string) float32

func String2Float64

func String2Float64(s string) float64

func String2Int

func String2Int(s string) int

func String2Int32

func String2Int32(s string) int32

func String2Int32List

func String2Int32List(s string, split string) []int32

func String2Int64

func String2Int64(s string) int64

func String2Int64List

func String2Int64List(s string, split string) []int64

func String2Int8

func String2Int8(s string) int8

func String2IntList

func String2IntList(s string, split string) []int

func String2UInt

func String2UInt(s string) uint

func String2UInt32

func String2UInt32(s string) uint32

func String2UInt32List

func String2UInt32List(s string, split string) []uint32

func String2UInt64

func String2UInt64(s string) uint64

func String2UInt64List

func String2UInt64List(s string, split string) []uint64

func StringSplit

func StringSplit(s string, sep string) []string

func UInt322String

func UInt322String(v uint32) string

func UInt642String

func UInt642String(v uint64) string

Types

type Float32Slice added in v0.0.18

type Float32Slice []float32

func (Float32Slice) GormDBDataType added in v0.0.18

func (Float32Slice) GormDBDataType(db *gorm.DB, field *schema.Field) string

GormDBDataType gorm db data type

func (Float32Slice) GormDataType added in v0.0.18

func (s Float32Slice) GormDataType() string

func (*Float32Slice) Scan added in v0.0.18

func (s *Float32Slice) Scan(val interface{}) error

func (Float32Slice) Value added in v0.0.18

func (s Float32Slice) Value() (driver.Value, error)

type Float64Slice added in v0.0.18

type Float64Slice []float64

func (Float64Slice) GormDBDataType added in v0.0.18

func (Float64Slice) GormDBDataType(db *gorm.DB, field *schema.Field) string

GormDBDataType gorm db data type

func (Float64Slice) GormDataType added in v0.0.18

func (s Float64Slice) GormDataType() string

func (*Float64Slice) Scan added in v0.0.18

func (s *Float64Slice) Scan(val interface{}) error

func (Float64Slice) Value added in v0.0.18

func (s Float64Slice) Value() (driver.Value, error)

type Int64Slice added in v0.0.18

type Int64Slice []int64

func (Int64Slice) GormDBDataType added in v0.0.18

func (Int64Slice) GormDBDataType(db *gorm.DB, field *schema.Field) string

GormDBDataType gorm db data type

func (Int64Slice) GormDataType added in v0.0.18

func (s Int64Slice) GormDataType() string

func (*Int64Slice) Scan added in v0.0.18

func (s *Int64Slice) Scan(val interface{}) error

func (Int64Slice) Value added in v0.0.18

func (s Int64Slice) Value() (driver.Value, error)

type IntSlice added in v0.0.18

type IntSlice []int

func (IntSlice) GormDBDataType added in v0.0.18

func (IntSlice) GormDBDataType(db *gorm.DB, field *schema.Field) string

GormDBDataType gorm db data type

func (IntSlice) GormDataType added in v0.0.18

func (s IntSlice) GormDataType() string

func (*IntSlice) Scan added in v0.0.18

func (s *IntSlice) Scan(val interface{}) error

func (IntSlice) Value added in v0.0.18

func (s IntSlice) Value() (driver.Value, error)

type JoberStatus added in v0.0.18

type JoberStatus uint32
const (
	NormalJobStatus JoberStatus = 1
	DoingJobStatus  JoberStatus = 2
)

type MetuxJobUtil added in v0.0.18

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

func NewMetuxJobUtil added in v0.0.18

func NewMetuxJobUtil(prefixName string, reg Register, etcdCli *etcdclient.Client, timeout, retry int) *MetuxJobUtil

func (*MetuxJobUtil) JobStatus added in v0.0.18

func (util *MetuxJobUtil) JobStatus() JoberStatus

func (*MetuxJobUtil) TryRun added in v0.0.18

func (util *MetuxJobUtil) TryRun(job func())

type Reference added in v0.0.17

type Reference struct {
	CloseHandler func()
	// contains filtered or unexported fields
}

func (*Reference) Free added in v0.0.17

func (ref *Reference) Free()

func (*Reference) LazyFree added in v0.0.18

func (ref *Reference) LazyFree(lazySecond int)

func (*Reference) Release added in v0.0.17

func (ref *Reference) Release()

func (*Reference) Retain added in v0.0.17

func (ref *Reference) Retain()

type Register added in v0.0.18

type Register interface {
	// Register the registration.
	Register(ctx context.Context) error
	// Deregister the registration.
	Deregister(ctx context.Context) error
}

type StringMap added in v0.0.18

type StringMap map[string]string

func (StringMap) GormDataType added in v0.0.18

func (s StringMap) GormDataType() string

func (*StringMap) Scan added in v0.0.18

func (s *StringMap) Scan(val interface{}) error

func (StringMap) Value added in v0.0.18

func (s StringMap) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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