Documentation ¶
Index ¶
- func ConvertMap2String(meta map[string]string) string
- func ConvertMeta2Map(meta string) map[string]string
- func CopyMeta(src, dst map[string]string)
- func CreateServiceKey(addr string) string
- func ExternalIPV4() (string, error)
- func ExternalIPV6() (string, error)
- func GetFreePort() (port int, err error)
- func GetHostport(serviceKey string) string
- func ParseRpcxAddress(addr string) (network string, ip string, port int, err error)
- func ServiceNamespace() string
- func SetServiceNamespace(prefix string)
- func SliceByteToString(b []byte) string
- func StringToSliceByte(s string) []byte
- func Unzip(data []byte) ([]byte, error)
- func Zip(data []byte) ([]byte, error)
- type LimitedPool
- type ServiceInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertMap2String ¶ added in v1.6.41
func ConvertMeta2Map ¶ added in v1.6.41
func CreateServiceKey ¶ added in v1.6.41
func ExternalIPV4 ¶ added in v1.6.41
ExternalIPV4 gets external IPv4 address of this server.
func ExternalIPV6 ¶ added in v1.6.41
ExternalIPV6 gets external IPv6 address of this server.
func GetFreePort ¶ added in v1.3.1
GetFreePort gets a free port.
func GetHostport ¶ added in v1.6.41
func ParseRpcxAddress ¶ added in v1.6.41
ParseRpcxAddress parses rpcx address such as tcp@127.0.0.1:8972 quic@192.168.1.1:9981
func ServiceNamespace ¶ added in v1.6.41
func ServiceNamespace() string
ServiceNamespace returns the service prefix of ETCD key.
func SetServiceNamespace ¶ added in v1.6.41
func SetServiceNamespace(prefix string)
SetServiceNamespace sets the service prefix of ETCD key. Note: It should be called the first time after importing this package.
func SliceByteToString ¶
func StringToSliceByte ¶
Types ¶
type LimitedPool ¶ added in v1.6.41
type LimitedPool struct {
// contains filtered or unexported fields
}
func NewLimitedPool ¶ added in v1.6.41
func NewLimitedPool(minSize, maxSize int) *LimitedPool
func (*LimitedPool) Get ¶ added in v1.6.41
func (p *LimitedPool) Get(size int) *[]byte
func (*LimitedPool) Put ¶ added in v1.6.41
func (p *LimitedPool) Put(b *[]byte)
type ServiceInfo ¶ added in v1.6.41
type ServiceInfo struct { UriPaths []string `json:"uri_paths"` // contains filtered or unexported fields }
ServiceInfo serivce info
func GetServiceInfo ¶ added in v1.6.41
func GetServiceInfo(value []byte) *ServiceInfo
func (*ServiceInfo) Append ¶ added in v1.6.41
func (s *ServiceInfo) Append(uriPath ...string)
Append appends uri path
func (*ServiceInfo) String ¶ added in v1.6.41
func (s *ServiceInfo) String() string
String returns the JSON string.
Click to show internal directories.
Click to hide internal directories.