shared

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseClient

func BaseClient(config *configuration.Config) *resty.Client

BaseClient should configure Resty "globally", not in any service-dependent way

func CheckResponse

func CheckResponse(response *resty.Response, err error) error

CheckResponse returns an error if the response wasn't successful. This helps us safely call response.Result() when err is nil, because a non-200-series response normally does not produce any sort of error but the Result() will be empty.

func LogLn

func LogLn(config *configuration.Config, alwaysPrint string, verbosePrint ...string)

LogLn prints each non-empty string if configuration.Verbose, only the first string otherwise.

Example (Concise)
LogLn(&configuration.Config{
	Verbose: false,
}, "always", "verbose 1", "verbose 2")
Output:

always
Example (Verbose)
LogLn(&configuration.Config{
	Verbose: true,
}, "always", "verbose 1", "verbose 2")
Output:

always
verbose 1
verbose 2

Types

This section is empty.

Jump to

Keyboard shortcuts

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