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 GetReqIDFromContext(ctx context.Context) string
- func GetServiceMemberIndex(memberName string) (int64, error)
- 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 GetReqIDFromContext ¶
GetReqIDFromContext gets the requuid from ctx.
func GetServiceMemberIndex ¶
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.