api

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const STANDARD_VERSION string = "1"

Variables

This section is empty.

Functions

This section is empty.

Types

type APIRequest added in v0.9.0

type APIRequest struct {
	http.Request
}

func (*APIRequest) Prepare added in v0.9.0

func (req *APIRequest) Prepare(signer *crypto.Signer, meta *Metadata) error

func (*APIRequest) Respond added in v0.9.0

func (req *APIRequest) Respond(signer *crypto.Signer, meta *Metadata, body *bytes.Buffer) (*APIResponse, error)

func (*APIRequest) Verify added in v0.9.0

func (req *APIRequest) Verify(signer *crypto.Signer) (bool, error)

type APIResponse added in v0.9.0

type APIResponse struct {
	http.Response
}

func (*APIResponse) Prepare added in v0.9.0

func (res *APIResponse) Prepare(signer *crypto.Signer, meta *Metadata) error

func (*APIResponse) Verify added in v0.9.0

func (res *APIResponse) Verify(signer *crypto.Signer) (bool, error)

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