utils

package
v1.2.2-dev.104 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseGetAllObjectsRequestQueryString

func ParseGetAllObjectsRequestQueryString(r *http.Request, minOffset int, maxOffset int, minLimit int, maxLimit int) (offset int, limit int, labels []string, err errors.EdgeX)

func ParseQueryStringToInt

func ParseQueryStringToInt(r *http.Request, queryStringKey string, defaultValue int, min int, max int) (int, errors.EdgeX)

Parse the specified query string key to an integer. If specified query string key is found more than once in the http request, only the first specified query string will be parsed and converted to an integer. If no specified query string key could be found in the http request, specified default value will be returned. EdgeX error will be returned if any parsing error occurs.

func ParseQueryStringToStrings

func ParseQueryStringToStrings(r *http.Request, queryStringKey string, separator string) (stringArray []string)

Parse the specified query string key to an array of string. If specified query string key is found more than once in the http request, only the first specified query string will be parsed and converted to an array of string. The value of query string will be split into an array of string by the passing separator. If separator is passed in as an empty string, comma separator will be used.

func WriteHttpHeader

func WriteHttpHeader(w http.ResponseWriter, ctx context.Context, statusCode int)

Types

This section is empty.

Jump to

Keyboard shortcuts

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