utils

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertBoolToInt64

func ConvertBoolToInt64(value bool) int64

ConvertBoolToInt64 bool转整形

func ConvertInt64ToBool

func ConvertInt64ToBool(value int64) bool

func ConvertSqlNullTimeToUnix

func ConvertSqlNullTimeToUnix(value sql.NullTime) int64

func ConvertSqlStringToString

func ConvertSqlStringToString(value sql.NullString) string

func DelStringByElement

func DelStringByElement(array []string, element string) ([]string, error)

DelStringByElement 删除数组中的元素

func Md5

func Md5(value string, salt string) string

Md5 密码加密

func RandInt

func RandInt(len int) string

RandInt 生成随机数字字符串

func RandString

func RandString(len int) string

RandString 生成随机大写字符串

func RandStringRunes

func RandStringRunes(n int) string

RandStringRunes 随机字符串

func SqlNullInt64ToInt64

func SqlNullInt64ToInt64(value sql.NullInt64) int64

func TraceSpan

func TraceSpan(serviceName string, spanName string, ctx context.Context) (context.Context, oteltrace.Span)

Types

type StringSet

type StringSet struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewStringSet

func NewStringSet(items ...string) *StringSet

func (*StringSet) Add

func (s *StringSet) Add(items ...string)

func (*StringSet) Clear

func (s *StringSet) Clear()

func (*StringSet) Complement

func (s *StringSet) Complement(full *StringSet) *StringSet

Complement 补

func (*StringSet) Count

func (s *StringSet) Count() int

func (*StringSet) Empty

func (s *StringSet) Empty() bool

func (*StringSet) Has

func (s *StringSet) Has(items ...string) bool

func (*StringSet) Intersect

func (s *StringSet) Intersect(sets ...*StringSet) *StringSet

Intersect 交

func (*StringSet) Minus

func (s *StringSet) Minus(sets ...*StringSet) *StringSet

Minus 差

func (*StringSet) Remove

func (s *StringSet) Remove(items ...string)

func (*StringSet) ToArray

func (s *StringSet) ToArray() []string

func (*StringSet) Union

func (s *StringSet) Union(sets ...*StringSet) *StringSet

Union 并

Jump to

Keyboard shortcuts

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