utils

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: Apache-2.0 Imports: 13 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteRequest

func DeleteRequest(ctx context.Context, returnValuePointer interface{}, baseUrl string, requestPath string) errors.EdgeX

DeleteRequest makes the delete request and return the body

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{}, baseUrl string, requestPath string, requestParams url.Values) errors.EdgeX

GetRequest makes the get request and return the body

func GetRequestAndReturnBinaryRes

func GetRequestAndReturnBinaryRes(ctx context.Context, baseUrl string, requestPath string, requestParams url.Values) (res []byte, contentType string, edgeXerr errors.EdgeX)

GetRequestAndReturnBinaryRes makes the get request and return the binary response and content type(i.e., application/json, application/cbor, ... )

func GetRequestWithBodyRawData added in v2.1.0

func GetRequestWithBodyRawData(ctx context.Context, returnValuePointer interface{}, baseUrl string, requestPath string, requestParams url.Values, data interface{}) errors.EdgeX

GetRequestWithBodyRawData makes the GET request with JSON raw data as request body and return the response

func PatchRequest

func PatchRequest(
	ctx context.Context,
	returnValuePointer interface{},
	baseUrl string, requestPath string,
	requestParams url.Values,
	data interface{}) errors.EdgeX

PatchRequest makes a PATCH request and unmarshals the response to the returnValuePointer

func PostByFileRequest

func PostByFileRequest(
	ctx context.Context,
	returnValuePointer interface{},
	baseUrl string, requestPath string,
	filePath string) errors.EdgeX

PostByFileRequest makes the post file request and return the body

func PostRequest

func PostRequest(
	ctx context.Context,
	returnValuePointer interface{},
	baseUrl string, requestPath string,
	data []byte,
	encoding string) errors.EdgeX

PostRequest makes the post request with encoded data and return the body

func PostRequestWithRawData

func PostRequestWithRawData(
	ctx context.Context,
	returnValuePointer interface{},
	baseUrl string, requestPath string,
	requestParams url.Values,
	data interface{}) errors.EdgeX

PostRequestWithRawData makes the post JSON request with raw data and return the body

func PutByFileRequest

func PutByFileRequest(
	ctx context.Context,
	returnValuePointer interface{},
	baseUrl string, requestPath string,
	filePath string) errors.EdgeX

PutByFileRequest makes the put file request and return the body

func PutRequest

func PutRequest(
	ctx context.Context,
	returnValuePointer interface{},
	baseUrl string, requestPath string,
	requestParams url.Values,
	data interface{}) errors.EdgeX

PutRequest makes the put JSON request and return the body

Types

This section is empty.

Jump to

Keyboard shortcuts

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