utils

package
v0.1.113 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: Apache-2.0 Imports: 7 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContext

func FromContext(ctx context.Context, key string) string

FromContext allows for the retrieval of the specified key's value from the supplied Context. If the value is not found, an empty string is returned.

func GetRequest

func GetRequest(ctx context.Context, returnValuePointer interface{}, url string) errors.EdgeX

GetRequest will make a GET request to the specified URL, and parse the JSON-encoded response body to the value pointed to by returnValuePointer.

Types

type CorrelatedRequest

type CorrelatedRequest struct {
	*http.Request
}

CorrelatedRequest is a wrapper type for use in managing Correlation IDs during service to service API calls.

func NewCorrelatedRequest

func NewCorrelatedRequest(ctx context.Context, req *http.Request) CorrelatedRequest

NewCorrelatedRequest will add the Correlation ID header to the supplied request. If no Correlation ID header is present in the supplied context, one will be created along with a value.

Jump to

Keyboard shortcuts

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