utils

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(slice []string, item string) bool

func FormatMessage

func FormatMessage(msg, format string) string

func NewThrottledTransport added in v1.0.1

func NewThrottledTransport(limitPeriod time.Duration, requestCount int, transport http.RoundTripper) http.RoundTripper

NewThrottledTransport wraps transport with a rate limitter

func SelectFormat

func SelectFormat(cliFormat, configFormat string) string

Types

type ThrottledTransport added in v1.0.1

type ThrottledTransport struct {
	// contains filtered or unexported fields
}

ThrottledTransport is Rate Limited HTTP Client

func (*ThrottledTransport) RoundTrip added in v1.0.1

func (c *ThrottledTransport) RoundTrip(r *http.Request) (*http.Response, error)

RoundTrip implements the http.RoundTripper interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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