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 ¶
- func CookiesToString(cookies []*http.Cookie) string
- func GetRetry(numRetries int, objName string, obj interface{}, ...) error
- func GetTOToolNameAndURL(globalParams []tc.Parameter) (string, string)
- func MaybeIPStr(addr net.Addr) string
- func RetryBackoffSeconds(currentRetry int) int
- func StringToCookies(cookiesStr string) []*http.Cookie
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CookiesToString ¶
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 MaybeIPStr ¶
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 StringToCookies ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.