torequtil

package
v6.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 8 Imported by: 0

Documentation

Overview

torequtil has utility functions used by toreq and toreqnew which don't require the Traffic Ops client, and thus can be shared.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CookiesToString

func CookiesToString(cookies []*http.Cookie) string

func GetRetry

func GetRetry(numRetries int, objName string, obj interface{}, getter func(obj interface{}) error) error

GetRetry attempts to get the given object, retrying with exponential backoff up to cfg.NumRetries. The objName is not used in actual fetching or logic, but only for logging. It can be any printable string, but should be unique and reflect the object being fetched.

func GetTOToolNameAndURL

func GetTOToolNameAndURL(globalParams []tc.Parameter) (string, string)

func MaybeIPStr

func MaybeIPStr(addr net.Addr) string

MaybeIPStr returns the addr string if it isn't nil, or the empty string if it is. This is intended for logging, to allow logging with one line, whether addr is nil or not.

func RetryBackoffSeconds

func RetryBackoffSeconds(currentRetry int) int

func StringToCookies

func StringToCookies(cookiesStr string) []*http.Cookie

Types

This section is empty.

Jump to

Keyboard shortcuts

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