Documentation ¶
Index ¶
- func B64ToHex(data string) (string, error)
- func ComputeB64MD5(data []byte) string
- func ComputeFileB64MD5(path string) (string, error)
- func CopyFile(src, dst string) error
- func FileExists(path string) (bool, error)
- func GenerateAlphanumericSequence(length int) string
- func HexToB64(data string) (string, error)
- func NilIfZero[T comparable](x T) *T
- func PrintFooterOffline(settings *service.Settings)
- func PrintFooterOnline(run *service.RunRecord, settings *service.Settings)
- func PrintHeadFoot(run *service.RunRecord, settings *service.Settings, footer bool)
- func ShortID(length int) string
- func VerifyFileHash(path string, b64md5 string) bool
- func WriteJsonToFileWithDigest(marshallable interface{}) (filename string, digest string, size int64, rerr error)
- func ZeroIfNil[T comparable](x *T) T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func B64ToHex ¶
B64ToHex converts a base64 encoded string to a hexadecimal string. It returns an error if the string provided is not a valid base64 string.
func ComputeB64MD5 ¶
ComputeB64MD5 computes the MD5 hash of the given data and returns the result as a base64 encoded string.
func ComputeFileB64MD5 ¶
ComputeFileB64MD5 computes the MD5 hash of the file at the given path and returns the result as a base64 encoded string. It returns an error if the file cannot be opened or read.
func CopyFile ¶
CopyFile copies the contents of `src` into `dst`.
If the source doesn't exist this is a no-op and an error is returned.
If the destination exists, it will be overwritten.
This operation is not atomic: if either the source or destination files are modified during the copy, the destination file's contents may be corrupted.
func FileExists ¶
func HexToB64 ¶
HexToB64 converts a hexadecimal string to a base64 encoded string. It returns an error if the string provided is not valid hexadecimal.
func NilIfZero ¶
func NilIfZero[T comparable](x T) *T
func PrintFooterOffline ¶
func PrintHeadFoot ¶
This is used by the go wandb client to print the header and footer of the run
func VerifyFileHash ¶
VerifyFileHash checks if file at the given path matches the MD5 hash provided as a base64 encoded string. It returns true if the file is present and matches the hash, false otherwise -- including if the file is missing, a directory, or can't be read.
func ZeroIfNil ¶
func ZeroIfNil[T comparable](x *T) T
Types ¶
This section is empty.