utils

package
v1.0.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ROCKETMQ_HOME_ENV           = "ROCKETMQ_HOME"
	ROCKETMQ_HOME_PROPERTY      = "rocketmq.home.dir"
	NAMESRV_ADDR_ENV            = "NAMESRV_ADDR"
	NAMESRV_ADDR_PROPERTY       = "rocketmq.namesrv.addr"
	MESSAGE_COMPRESS_LEVEL      = "rocketmq.message.compressLevel"
	DEFAULT_NAMESRV_ADDR_LOOKUP = "jmenv.tbsite.net"
	DEFAULT_TOPIC               = "TBW102"
	BENCHMARK_TOPIC             = "BenchmarkTest"
	DEFAULT_PRODUCER_GROUP      = "DEFAULT_PRODUCER"
	DEFAULT_CONSUMER_GROUP      = "DEFAULT_CONSUMER"
	TOOLS_CONSUMER_GROUP        = "TOOLS_CONSUMER"
	FILTERSRV_CONSUMER_GROUP    = "FILTERSRV_CONSUMER"
	MONITOR_CONSUMER_GROUP      = "__MONITOR_CONSUMER"
	CLIENT_INNER_PRODUCER_GROUP = "CLIENT_INNER_PRODUCER"
	SELF_TEST_PRODUCER_GROUP    = "SELF_TEST_P_GROUP"
	SELF_TEST_CONSUMER_GROUP    = "SELF_TEST_C_GROUP"
	SELF_TEST_TOPIC             = "SELF_TEST_TOPIC"
	OFFSET_MOVED_EVENT          = "OFFSET_MOVED_EVENT"
	ONS_HTTP_PROXY_GROUP        = "CID_ONS-HTTP-PROXY"
	CID_ONSAPI_PERMISSION_GROUP = "CID_ONSAPI_PERMISSION"
	CID_ONSAPI_OWNER_GROUP      = "CID_ONSAPI_OWNER"
	CID_ONSAPI_PULL_GROUP       = "CID_ONSAPI_PULL"
	CID_RMQ_SYS_PREFIX          = "CID_RMQ_SYS_"
	DEFAULT_CHARSET             = "UTF-8"
	MASTER_ID                   = 0
	RETRY_GROUP_TOPIC_PREFIX    = "%RETRY%"
	DLQ_GROUP_TOPIC_PREFIX      = "%DLQ%"
	SYSTEM_TOPIC_PREFIX         = "rmq_sys_"
	UNIQUE_MSG_QUERY_FLAG       = "_UNIQUE_KEY_QUERY"
	DEFAULT_TRACE_REGION_ID     = "DefaultRegion"
	CONSUME_CONTEXT_TYPE        = "ConsumeContextType"
)

Variables

View Source
var (
	LocalIP string
)
View Source
var MixAllUtil = &MixAll{}

Functions

func AbsInt

func AbsInt(i int) int

func CheckError

func CheckError(action string, err error)

func ClientIP4

func ClientIP4() ([]byte, error)

func Compress

func Compress(raw []byte, compressLevel int) ([]byte, error)

func FakeIP

func FakeIP() []byte

func FileReadAll

func FileReadAll(path string) ([]byte, error)

func GetAddressByBytes

func GetAddressByBytes(data []byte) string

func HashString

func HashString(s string) int

HashString hashes a string to a unique hashcode.

func IsEmpty

func IsEmpty(s string) bool

func MinInt

func MinInt(a, b int) int

func UnCompress

func UnCompress(data []byte) []byte

func WithoutNamespace

func WithoutNamespace(resource string) string

func WrapNamespace

func WrapNamespace(namespace, resourceWithOutNamespace string) string

func WriteToFile

func WriteToFile(path string, data []byte) error

Types

type MixAll

type MixAll struct {
}

func (*MixAll) BrokerVIPChannel

func (u *MixAll) BrokerVIPChannel(isChange bool, brokerAddr string) string

func (*MixAll) GetDLQTopic

func (u *MixAll) GetDLQTopic(consumerGroup string) string

func (*MixAll) GetPID

func (u *MixAll) GetPID() int

func (*MixAll) GetRetryTopic

func (u *MixAll) GetRetryTopic(consumerGroup string) string

func (*MixAll) IsSysConsumerGroup

func (u *MixAll) IsSysConsumerGroup(consumerGroup string) bool

func (*MixAll) IsSystemTopic

func (u *MixAll) IsSystemTopic(topic string) bool

func (*MixAll) StringToProperties added in v1.0.7

func (u *MixAll) StringToProperties(str string) map[string]string

type Set

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

func NewSet

func NewSet() Set

func (*Set) Add

func (s *Set) Add(v UniqueItem)

func (*Set) AddKV

func (s *Set) AddKV(k, v string)

func (*Set) Contains

func (s *Set) Contains(k string) (UniqueItem, bool)

func (*Set) Items

func (s *Set) Items() map[string]UniqueItem

func (*Set) Len

func (s *Set) Len() int

func (*Set) MarshalJSON

func (s *Set) MarshalJSON() ([]byte, error)

func (*Set) UnmarshalJSON

func (s *Set) UnmarshalJSON(data []byte) (err error)

type StringUnique

type StringUnique string

func (StringUnique) UniqueID

func (str StringUnique) UniqueID() string

type UniqueItem

type UniqueItem interface {
	UniqueID() string
}

Jump to

Keyboard shortcuts

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