config

package
v0.0.0-...-f574766 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: MIT Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RequestMethodIsInvalidError  = errors.New("The request method is invalid")
	HTTPSchemaIncludedError      = errors.New("The request url shouldn't contains http or https")
	EmptyRequestBodyForPostError = errors.New("The request body shouldn't be empty if the request method is POST")
	EscherKeyIsInvalidError      = errors.New("Invalid Escher key")
)

Functions

func SetDefaults

func SetDefaults(c *Config)

Types

type Config

type Config struct {
	Date            string
	HashAlgo        string
	ApiSecret       string
	VendorKey       string
	AlgoPrefix      string
	AccessKeyId     string
	AuthHeaderName  string
	DateHeaderName  string
	CredentialScope string
}

func NewFromENV

func NewFromENV() (Config, error)

func ParseJSON

func ParseJSON(data []byte) (*Config, error)

func (Config) ComposedAlgorithm

func (c Config) ComposedAlgorithm() string

func (Config) DateInEscherFormat

func (c Config) DateInEscherFormat() string

func (Config) DateInHTTPHeaderFormat

func (c Config) DateInHTTPHeaderFormat() string

func (Config) GetAlgoPrefix

func (c Config) GetAlgoPrefix() string

func (Config) GetAuthHeaderName

func (c Config) GetAuthHeaderName() string

func (Config) GetDateHeaderName

func (c Config) GetDateHeaderName() string

func (Config) GetDateWithFormat

func (c Config) GetDateWithFormat(format string) string

func (Config) GetHashAlgo

func (c Config) GetHashAlgo() string

func (Config) GetVendorKey

func (c Config) GetVendorKey() string

func (Config) IsSigningInQuery

func (c Config) IsSigningInQuery(r request.Interface) bool

func (Config) QueryKeyFor

func (c Config) QueryKeyFor(key string) string

func (Config) Reconfig

func (c Config) Reconfig(date, hashAlgo, credentialScope, apiKeyID, apiSecret string) Config

func (Config) ShortDate

func (c Config) ShortDate() string

func (Config) SignatureQueryKey

func (c Config) SignatureQueryKey() string

func (*Config) UnmarshalJSON

func (c *Config) UnmarshalJSON(data []byte) error

func (Config) Validate

func (c Config) Validate(r request.Interface) error

type Interface

type Interface interface {
	json.Unmarshaler
}

Jump to

Keyboard shortcuts

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