api

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const STANDARD_VERSION string = "1"

Variables

This section is empty.

Functions

func PrepareRequest

func PrepareRequest(signer *crypto.Signer, data *bytes.Buffer, method string, url string, meta *Metadata) (*http.Request, error)

func PrepareResponse

func PrepareResponse(signer *crypto.Signer, body []byte, req *http.Request, meta *Metadata) (*http.Response, error)

func VerifyRequest

func VerifyRequest(signer *crypto.Signer, req *http.Request) (bool, error)

Types

type ApiHeader

type ApiHeader string
const (
	SIGNATURE_PUBKEY ApiHeader = "X-API-SIG-PUB"
	SIGNATURE        ApiHeader = "X-API-SIG"
	VERSION          ApiHeader = "X-API-VER"
	PROJECT          ApiHeader = "X-API-PROJ"
	STANDARD         ApiHeader = "X-API-STD"
)

type Metadata

type Metadata struct {
	Version   string
	ProjectID uint64
}

API Metadata

Jump to

Keyboard shortcuts

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