util

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: Apache-2.0 Imports: 13 Imported by: 31

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentMillis

func CurrentMillis() int64

func DeepCopyMap added in v1.1.0

func DeepCopyMap(params map[string]string) map[string]string

func GetConfigCacheKey

func GetConfigCacheKey(dataId string, group string, tenant string) string

func GetDurationWithDefault

func GetDurationWithDefault(metadata map[string]string, key string, defaultDuration time.Duration) time.Duration

func GetGroupName

func GetGroupName(serviceName string, groupName string) string

func GetServiceCacheKey

func GetServiceCacheKey(serviceName string, clusters string) string

func GetUrlFormedMap added in v1.0.1

func GetUrlFormedMap(source map[string]string) (urlEncoded string)

func JsonToService

func JsonToService(result string) *model.Service

func LocalIP

func LocalIP() string

func Md5

func Md5(content string) (md string)

func SetFilterNetNumberAndMask added in v1.0.8

func SetFilterNetNumberAndMask(ipMask ...string) error

SetFilterNetNumberAndMask ipMask like 127.0.0.0/8

func ToJsonString

func ToJsonString(object interface{}) string

func TransformObject2Param

func TransformObject2Param(object interface{}) (params map[string]string)

Types

type Semaphore

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

func NewSemaphore

func NewSemaphore(concurrencyNum int) *Semaphore

func (*Semaphore) Acquire

func (this *Semaphore) Acquire()

func (*Semaphore) AvailablePermits

func (this *Semaphore) AvailablePermits() int

func (*Semaphore) Release

func (this *Semaphore) Release()

func (*Semaphore) TryAcquire

func (this *Semaphore) TryAcquire() bool

Jump to

Keyboard shortcuts

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