Documentation ¶
Index ¶
- Variables
- func Alias(prefix, name string, cmd oodle.Command) oodle.Command
- func Contains(s []string, e string) bool
- func FakeBrowser(req *http.Request)
- func FakePOST(url string, body io.Reader) ([]byte, error)
- func FmtDur(d time.Duration) string
- func FmtTime(t time.Time) string
- func GetJSON(url string, data interface{}) error
- func LimitBody(rc io.ReadCloser, megaBytes int64) io.ReadCloser
- func Min(x, y int) int
- func ParseDuration(s string) (time.Duration, error)
- func RunCases(t *testing.T, cmd oodle.Command, tests []TestCase)
- func Summarize(text string) (summarized string)
- type LimitedReader
- type TestCase
Constants ¶
This section is empty.
Variables ¶
View Source
var HTTPClient = &http.Client{ Transport: netTransport, Timeout: 2 * time.Second, }
Functions ¶
func FakeBrowser ¶ added in v1.12.1
func LimitBody ¶ added in v1.12.1
func LimitBody(rc io.ReadCloser, megaBytes int64) io.ReadCloser
LimitBody is similar to io.LimitReader but it takes an io.ReadCloser and accepts the limit in megabytes
func ParseDuration ¶ added in v1.4.0
Note: fork of time.ParseDuration which supports more units ParseDuration parses a duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
Types ¶
type LimitedReader ¶ added in v1.12.1
type LimitedReader struct { R io.ReadCloser // underlying reader/closer N int64 // max bytes remaining }
func (*LimitedReader) Close ¶ added in v1.12.1
func (l *LimitedReader) Close() error
Click to show internal directories.
Click to hide internal directories.