Documentation
¶
Overview ¶
Package utils provides shared internal helpers for the aura-client module. Nothing in this package is part of the public API.
Index ¶
- func Base64Encode(s1, s2 string) string
- func CheckDate(t string) error
- func Marshal(payload any) ([]byte, error)
- func MarshalIndent(payload any) ([]byte, error)
- func TruncateString(s string, n int) string
- func Unmarshal[T any](payload []byte) (T, error)
- func ValidateInstanceID(instanceID string) error
- func ValidateSnapshotID(snapshotID string) error
- func ValidateTenantID(tenantID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64Encode ¶
Base64Encode returns the standard base64 encoding of "s1:s2", suitable for use as the credential in an HTTP Basic Authorization header.
func MarshalIndent ¶ added in v1.6.3
MarshalIndent returns the indented JSON encoding of payload.
func TruncateString ¶ added in v1.6.0
TruncateString returns the first n runes of s. If s contains n or fewer runes it is returned unchanged. Using rune counts rather than byte offsets ensures that multibyte UTF-8 characters are never split.
func ValidateInstanceID ¶ added in v1.1.0
ValidateInstanceID returns an error if instanceID is empty or not an 8-character hex string.
func ValidateSnapshotID ¶ added in v1.8.0
ValidateSnapshotID returns an error if snapshotID is empty or not a valid UUID.
func ValidateTenantID ¶ added in v1.0.5
ValidateTenantID returns an error if tenantID is empty or not a valid UUID.
Types ¶
This section is empty.