material

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SignatureHeader      = textproto.CanonicalMIMEHeaderKey("Signature")
	SignatureInputHeader = textproto.CanonicalMIMEHeaderKey("Signature-Input")
	SigningVersionHeader = textproto.CanonicalMIMEHeaderKey("Upvest-Signature-Version")
	ContentDigestHeader  = textproto.CanonicalMIMEHeaderKey("Content-Digest")
)
View Source
var (
	ErrWrongValueSymbol     = errors.New("wrong value symbol")
	ErrImbalancedQuotes     = errors.New("imbalanced quotes")
	ErrWrongKeySymbol       = errors.New("wrong key symbol")
	ErrUnknownMaterialValue = errors.New("unknown material value")
)

Functions

func Format added in v1.2.0

func Format(k, v string) string

func GetRequestBody added in v1.2.0

func GetRequestBody(req *http.Request) ([]byte, error)

func Normalise added in v1.2.0

func Normalise(k string, v []string) ([]string, []string, error)

Types

type Material

type Material struct {
	Data           map[string]string
	Names          []string
	Created        string
	Expires        string
	Nonce          string
	Body           []byte
	SourceBody     []byte
	SignatureInput string
}

func MaterialFromRequest added in v1.2.0

func MaterialFromRequest(req *http.Request) (*Material, error)

func (*Material) AppendArray added in v1.2.0

func (e *Material) AppendArray(k string, v []string) error

func (*Material) AppendHeaders

func (e *Material) AppendHeaders(headers http.Header) error

func (*Material) AppendValue added in v1.2.0

func (e *Material) AppendValue(k, v string)

func (*Material) CompleteWithSourceBody added in v1.2.0

func (e *Material) CompleteWithSourceBody(postBodyData ...string)

func (*Material) GetBody added in v1.2.0

func (e *Material) GetBody(keyID string) ([]byte, string, error)

Jump to

Keyboard shortcuts

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