Documentation ¶
Index ¶
- func AppendToFile(filePath, content string) error
- func BytesToGB(size interface{}) int64
- func DecryptAESCBC(key, ciphertext string) (string, error)
- func DeleteFile(file string) error
- func EncryptAESCBC(key, original string) (string, error)
- func FormatHeaders(headers http.Header, separator string) string
- func LogGRPC(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- func ParseEndpoint(ep string) (string, string, error)
- func RedactHeaders(headers http.Header) (processedHeaders []string)
- func RoundUpSize(volumeSizeBytes int64, allocationUnitBytes int64) int64
- func Sha256(valueMap map[string]string) string
- func WriteToFile(filePath, content string) error
- type LogRoundTripper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendToFile ¶
func DecryptAESCBC ¶
func DeleteFile ¶
func EncryptAESCBC ¶
func FormatHeaders ¶
FormatHeaders processes a headers object plus a deliminator, returning a string
func LogGRPC ¶
func LogGRPC(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
func RedactHeaders ¶
RedactHeaders processes a headers object, returning a redacted list
func RoundUpSize ¶
RoundUpSize calculates how many allocation units are needed to accommodate a volume of given size. E.g. when user wants 1500Mi volume, while HuaweiCLoud EVS/SFS allocates volumes in Gi byte-sized chunks, RoundUpSize(1500 * 1024*1024, 1024*1024*1024) returns '2' (2 GiB is the smallest allocatable volume that can hold 1500MiB)
func WriteToFile ¶
Types ¶
type LogRoundTripper ¶
type LogRoundTripper struct {
Rt http.RoundTripper
}
LogRoundTripper satisfies the http.RoundTripper interface and is used to customize the default http client RoundTripper to allow for logging.
Click to show internal directories.
Click to hide internal directories.