pingrequest

package
v10.317.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const PingHeaderKey = "X-APORETO-PING"

PingHeaderKey holds the value for aporeto ping.

Variables

This section is empty.

Functions

func Create

func Create(host string, pingPayload *policy.PingPayload) (*http.Request, error)

Create creates a new http request with the given host. It encodes the pingPayload passed with msgpack encoding and adds the data bytes to the header with key 'X-APORETO-PING'. It also returns the request.

func CreateRaw

func CreateRaw(host string, pingPayload *policy.PingPayload) ([]byte, error)

CreateRaw is same as 'Create' but will return raw bytes of the request (wire format) returned by 'Create'.

func Extract

func Extract(req *http.Request) (*policy.PingPayload, error)

Extract verifies If the given request has the header 'X-APORETO-PING'. If it doesn't returns error, If it did have the header, it will try to decode the data using msgpack encoding and will return the ping payload.

func ExtractRaw

func ExtractRaw(rawReq []byte) (*policy.PingPayload, error)

ExtractRaw is same as 'Extract' but will parse the raw bytes of the request passed and calls 'Validate'.

Types

This section is empty.

Jump to

Keyboard shortcuts

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