utils

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package utils provides shared internal helpers for the aura-client module. Nothing in this package is part of the public API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64Encode

func Base64Encode(s1, s2 string) string

Base64Encode returns the standard base64 encoding of "s1:s2", suitable for use as the credential in an HTTP Basic Authorization header.

func CheckDate

func CheckDate(t string) error

CheckDate returns an error if t is not a valid YYYY-MM-DD date string.

func Marshal added in v1.6.3

func Marshal(payload any) ([]byte, error)

Marshal returns the JSON encoding of payload.

func MarshalIndent added in v1.6.3

func MarshalIndent(payload any) ([]byte, error)

MarshalIndent returns the indented JSON encoding of payload.

func TruncateString added in v1.6.0

func TruncateString(s string, n int) string

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 Unmarshal

func Unmarshal[T any](payload []byte) (T, error)

Unmarshal copies a JSON payload into a value of type T.

func ValidateInstanceID added in v1.1.0

func ValidateInstanceID(instanceID string) error

ValidateInstanceID returns an error if instanceID is empty or not an 8-character hex string.

func ValidateSnapshotID added in v1.8.0

func ValidateSnapshotID(snapshotID string) error

ValidateSnapshotID returns an error if snapshotID is empty or not a valid UUID.

func ValidateTenantID added in v1.0.5

func ValidateTenantID(tenantID string) error

ValidateTenantID returns an error if tenantID is empty or not a valid UUID.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL