Documentation ¶
Index ¶
- Constants
- func CreateDirIfNotExist(dirpath string) error
- func CreateOrOverwriteFile(fpath string, data []byte, fileMode os.FileMode) error
- func GenCallerID() string
- func GenClientTLSConfig(caFile string, certFile string, keyFile string) (*tls.Config, error)
- func GenControlDBServiceUUID(volID string) string
- func GenMD5(content string) string
- func GenMemberConfigFileID(memberName string, configFileName string, version int64) string
- func GenRequestUUID() string
- func GenServerTLSConfigFromCAFile(caFile string) (*tls.Config, error)
- func GenServerTLSConfigWithCA(clientCACert []byte) (*tls.Config, error)
- func GenServiceMemberName(serviceName string, index int64) string
- func GenUUID() string
- func GetConfigFileVersion(fileID string) (version int64, err error)
- func GetControlDBVolumeID(controldbServiceUUID string) string
- func GetNextIP(usedIPs map[string]bool, ipnet *net.IPNet, lastIP net.IP) (nextIP net.IP, err error)
- func GetReqIDFromContext(ctx context.Context) string
- func GetServiceJournalVolumeName(serviceUUID string) string
- func Hash(s string) uint32
- func IsControlDBService(serviceUUID string) bool
- func IsDirExist(dirpath string) (bool, error)
- func IsFileExist(fpath string) (bool, error)
- func NewRequestContext(ctx context.Context, requuid string) context.Context
- func SetLogDir()
- func SetLogToStd()
Constants ¶
View Source
const ( DefaultDirMode = 0755 DefaultFileMode = 0644 )
Variables ¶
This section is empty.
Functions ¶
func CreateDirIfNotExist ¶
func CreateOrOverwriteFile ¶
func GenClientTLSConfig ¶
GenClientTLSConfig creates the tls Config for client
func GenControlDBServiceUUID ¶
func GenMemberConfigFileID ¶
func GenRequestUUID ¶
func GenRequestUUID() string
func GenServerTLSConfigFromCAFile ¶
GenServerTLSConfigFromCAFile creates a tls Config with ClientCAs.
func GenServerTLSConfigWithCA ¶
GenServerTLSConfigWithCA creates a tls Config with ClientCAs.
func GenServiceMemberName ¶
func GetConfigFileVersion ¶
func GetControlDBVolumeID ¶
GetControlDBVolumeID extracts the volume id from the controldb serviceUUID
func GetNextIP ¶ added in v0.8.1
GetNextIP gets the next unused ip. aws reserves like 10.0.0.0, 10.0.0.1, 10.0.0.2, 10.0.0.3 and 10.0.0.255, http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html
func GetReqIDFromContext ¶
GetReqIDFromContext gets the requuid from ctx.
func GetServiceJournalVolumeName ¶ added in v0.9.1
func IsControlDBService ¶
func IsDirExist ¶
func IsFileExist ¶
func NewRequestContext ¶
NewRequestContext returns a new Context carrying requuid.
func SetLogToStd ¶
func SetLogToStd()
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.