utils

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenPathTpl

func GenPathTpl() string

func GetDeliveryId

func GetDeliveryId() int64

func GetHandshakeUid

func GetHandshakeUid() uint64

func GetMsgType

func GetMsgType(manifest string) (string, error)

func GetUniqueId

func GetUniqueId(jobId, jobInstanceId, taskId int64) string

func GetUniqueIdWithoutTaskId

func GetUniqueIdWithoutTaskId(jobId, jobInstanceId int64) string

func GetWorkerId

func GetWorkerId() string

func HmacSHA1Encrypt

func HmacSHA1Encrypt(encryptText, encryptKey string) string

HmacSHA1Encrypt encrypt the encryptText use encryptKey

func IsValidDomain

func IsValidDomain(domain string) bool

func ParseIPAddr

func ParseIPAddr(addr string) (string, int, error)

func ParseId

func ParseId(uniqueId string, idType IdType) (int64, error)

func ShuffleStringSlice

func ShuffleStringSlice(nums []string) []string

func SyncMapLen

func SyncMapLen(m *sync.Map) int

Types

type ConcurrentSet

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

func NewConcurrentSet

func NewConcurrentSet() *ConcurrentSet

func (*ConcurrentSet) Add

func (s *ConcurrentSet) Add(item interface{})

func (*ConcurrentSet) Clear

func (s *ConcurrentSet) Clear()

func (*ConcurrentSet) Contains

func (s *ConcurrentSet) Contains(item interface{}) bool

func (*ConcurrentSet) Len

func (s *ConcurrentSet) Len() int

func (*ConcurrentSet) Remove

func (s *ConcurrentSet) Remove(item interface{})

func (*ConcurrentSet) ToStringSlice

func (s *ConcurrentSet) ToStringSlice() []string

type IdType

type IdType int32
const (
	IdTypeJobId         IdType = 0
	IdTypeJobInstanceId IdType = 1
	IdTypeTaskId        IdType = 2

	SplitterToken = "_"
)

type Set

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

func NewSet

func NewSet() *Set

func (*Set) Add

func (s *Set) Add(item interface{})

func (*Set) Contains

func (s *Set) Contains(item interface{}) bool

func (*Set) Remove

func (s *Set) Remove(item interface{})

func (*Set) ToInt64Slice

func (s *Set) ToInt64Slice() []int64

Jump to

Keyboard shortcuts

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