utils

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 9 Imported by: 7

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 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