util

package
v0.0.0-...-f9daae4 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentMillis

func CurrentMillis() int64

func DeepCopyMap

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

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

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