Help us shape the future of Go! Take the 2026 Go Developer Survey

utils

package
v0.0.53 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 9 Imported by: 12

Documentation

Index

Constants

View Source
const (
	AccessKeySecretKey = "accessKey"
	AccountSecretKey   = "account"
)

Variables

This section is empty.

Functions

func CurrentDir

func CurrentDir() string

func Decode

func Decode[T any](rdr io.Reader) (T, error)

func ErrAPI

func ErrAPI(resp *http.Response) error

ErrAPI reports an API error, with a cap on the length of the error message.

func IsNativeFramework

func IsNativeFramework(framework string) bool

func ParseHost

func ParseHost(host string) (string, string, error)

ParseHost picks a host from a hostname or an URL and detects the scheme.

The default scheme is https. This may be altered by specifying an explicit http://hostname URL.

func ReadString

func ReadString(rdr io.Reader, sizeHint int64) (string, error)

Types

type APIError added in v0.0.53

type APIError struct {
	StatusCode int
	Status     string
	Reason     string
}

APIError is an API call that got an HTTP error status. Callers can read StatusCode with errors.As.

func (*APIError) Error added in v0.0.53

func (e *APIError) Error() string

type Credentials added in v0.0.10

type Credentials struct {
	Account   string `mapstructure:"account"`
	AccessKey string `mapstructure:"accessKey"`
}

func LoadCredentialsFromFile added in v0.0.10

func LoadCredentialsFromFile(secretPath string) (*Credentials, error)

LoadTokenFromFile loads the access key and the account from a mounted secret directory

Jump to

Keyboard shortcuts

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