Documentation ¶
Index ¶
Constants ¶
const PingHeaderKey = "X-APORETO-PING"
PingHeaderKey holds the value for aporeto ping.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
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.