resttestutil

package
v0.0.0-...-5905bd6 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructInternalPath

func ConstructInternalPath(subpath string, options ...ConstructURLOption) (string, error)

ConstructInternalPath constructs a URL with encoded parameters based on the non-nil fields of the provided struct via the form tag. Required path prefixes are added automatically.

func MustConstructInternalPath

func MustConstructInternalPath(subpath string, options ...ConstructURLOption) string

MustConstructInternalPath constructs a URL with encoded parameters based on the non-nil fields of the provided struct. Required path prefixes are added automatically. It panics if an error occurs during URL construction.

func ReqWithAPIKey

func ReqWithAPIKey(apiKey string) client.RequestEditorFn

Types

type ConstructURLOption

type ConstructURLOption func(*constructURLOptions)

ConstructURLOption is the type for options that can be passed to ConstructInternalPath.

func WithQueryParams

func WithQueryParams(params any) ConstructURLOption

WithQueryParams specifies the struct containing the query parameters.

Jump to

Keyboard shortcuts

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