common

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SignHeader = `Signature`
)
View Source
const (
	VersionHeader = `Accept`
)

Variables

View Source
var (

	//ErrInvalidSignature if invalid header format
	ErrInvalidSignature = errors.New("invalid signature header")
)

Functions

func GetVersion

func GetVersion(h http.Header) uint64

GetVersion getting version from header

func SetSignature

func SetSignature(h http.Header, s utils.Signer, body []byte)

SetSignature make and setting signature to header

func SetVersion

func SetVersion(h http.Header, v uint64)

SetVersion setting version to header

Types

type Signature

type Signature struct {
	ID   string
	Alg  string
	Hash string
}

Signature model

func GetSignature

func GetSignature(h http.Header) (s Signature, err error)

GetSignature getting signature from header

Jump to

Keyboard shortcuts

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