util

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package util provides some util function, such as ValidateHostPort.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertAddressStrToSlice

func ConvertAddressStrToSlice(addressStr string, enableHttps bool) []string

ConvertAddressStrToSlice convert address like "127.0.0.1:2379,127.0.0.1:2380" to endpoints like ["127.0.0.1:2379", "127.0.0.1:2380"] if enableHttps, the func will convert address to endpoints like ["https://127.0.0.1:2379", "https://127.0.0.1:2380"]

func EtcdKeyHideLogInfo added in v1.0.4

func EtcdKeyHideLogInfo(input string) string

func FileExists added in v1.0.2

func FileExists(filePath string) bool

func GetNearest2Power added in v0.1.0

func GetNearest2Power(old int) int

func GetWorkerIDByIp

func GetWorkerIDByIp() int64

GetWorkerIDByIp use ip low 10 bit to generate workerID

func MaxInt64 added in v0.1.0

func MaxInt64(x, y int64) int64

func ValidateHostPort

func ValidateHostPort(hostPort string) error

ValidateHostPort validate that hostPort is correct.

Types

This section is empty.

Jump to

Keyboard shortcuts

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