oreo

package module
v0.0.0-...-c5d80af Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: Apache-2.0 Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Build Status GoDoc

Oreo is a simple wrapper build on top of github.com/sethgrid/pester http client library. Oreo handles cookies and persist them to disk to be reused between client invocations.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBackoff = pester.DefaultBackoff

DefaultBackoff always returns 1 second

View Source
var ExponentialBackoff = pester.ExponentialBackoff

ExponentialBackoff = pester.ExponentialBackoff returns ever increasing backoffs by a power of 2

View Source
var ExponentialJitterBackoff = pester.ExponentialJitterBackoff

ExponentialJitterBackoff returns ever increasing backoffs by a power of 2 with +/- 0-33% to prevent sychronized reuqests.

View Source
var LinearBackoff = pester.LinearBackoff

LinearBackoff returns increasing durations, each a second longer than the last

View Source
var LinearJitterBackoff = pester.LinearJitterBackoff

LinearJitterBackoff returns increasing durations, each a second longer than the last with +/- 0-33% to prevent sychronized reuqests.

Functions

func NoRedirect

func NoRedirect(req *http.Request, _ []*http.Request) error

Types

type Client

type Client struct {
	pester.Client
	// contains filtered or unexported fields
}

func New

func New() *Client

func (*Client) Delete

func (c *Client) Delete(urlStr string) (resp *http.Response, err error)

func (*Client) DeleteJSON

func (c *Client) DeleteJSON(urlStr string, jsonStr string) (resp *http.Response, err error)

func (*Client) DeleteXML

func (c *Client) DeleteXML(urlStr string, xmlStr string) (resp *http.Response, err error)

func (*Client) Do

func (c *Client) Do(req *http.Request) (resp *http.Response, err error)

func (*Client) Get

func (c *Client) Get(urlStr string) (resp *http.Response, err error)

func (*Client) GetJSON

func (c *Client) GetJSON(urlStr string) (resp *http.Response, err error)

func (*Client) GetXML

func (c *Client) GetXML(urlStr string) (resp *http.Response, err error)

func (*Client) Head

func (c *Client) Head(urlStr string) (resp *http.Response, err error)

func (*Client) Patch

func (c *Client) Patch(urlStr string, bodyType string, body io.Reader) (resp *http.Response, err error)

func (*Client) PatchJSON

func (c *Client) PatchJSON(urlStr string, jsonStr string) (resp *http.Response, err error)

func (*Client) PatchXML

func (c *Client) PatchXML(urlStr string, xmlStr string) (resp *http.Response, err error)

func (*Client) Post

func (c *Client) Post(urlStr string, bodyType string, body io.Reader) (resp *http.Response, err error)

func (*Client) PostForm

func (c *Client) PostForm(urlStr string, data url.Values) (resp *http.Response, err error)

func (*Client) PostJSON

func (c *Client) PostJSON(urlStr string, jsonStr string) (resp *http.Response, err error)

func (*Client) PostXML

func (c *Client) PostXML(urlStr string, xmlStr string) (resp *http.Response, err error)

func (*Client) Put

func (c *Client) Put(urlStr string, bodyType string, body io.Reader) (resp *http.Response, err error)

func (*Client) PutJSON

func (c *Client) PutJSON(urlStr, jsonStr string) (resp *http.Response, err error)

func (*Client) PutXML

func (c *Client) PutXML(urlStr, xmlStr string) (resp *http.Response, err error)

func (*Client) WithBackoff

func (c *Client) WithBackoff(backoff pester.BackoffStrategy) *Client

func (*Client) WithCheckRedirect

func (c *Client) WithCheckRedirect(checkFunc func(*http.Request, []*http.Request) error) *Client

func (*Client) WithCookieFile

func (c *Client) WithCookieFile(file string) *Client

func (*Client) WithLogger

func (c *Client) WithLogger(l Logger) *Client

func (*Client) WithPostCallback

func (c *Client) WithPostCallback(callback PostRequestCallback) *Client

func (*Client) WithPreCallback

func (c *Client) WithPreCallback(callback PreRequestCallback) *Client

func (*Client) WithRequestTrace

func (c *Client) WithRequestTrace(b bool) *Client

func (*Client) WithResponseTrace

func (c *Client) WithResponseTrace(b bool) *Client

func (*Client) WithRetries

func (c *Client) WithRetries(retries int) *Client

func (*Client) WithRetryOnHTTP429

func (c *Client) WithRetryOnHTTP429() *Client

func (*Client) WithTimeout

func (c *Client) WithTimeout(duration time.Duration) *Client

func (*Client) WithTrace

func (c *Client) WithTrace(b bool) *Client

func (*Client) WithTransport

func (c *Client) WithTransport(transport http.RoundTripper) *Client

func (*Client) WithoutCallbacks

func (c *Client) WithoutCallbacks() *Client

func (*Client) WithoutPostCallbacks

func (c *Client) WithoutPostCallbacks() *Client

func (*Client) WithoutPreCallbacks

func (c *Client) WithoutPreCallbacks() *Client

func (*Client) WithoutRedirect

func (c *Client) WithoutRedirect() *Client

type Logger

type Logger interface {
	Printf(format string, args ...interface{})
}
var DefaultLogger Logger = &nullLogger{}

type PostRequestCallback

type PostRequestCallback func(*http.Request, *http.Response) (*http.Response, error)

type PreRequestCallback

type PreRequestCallback func(*http.Request) (*http.Request, error)

type ReqBuilder

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

func RequestBuilder

func RequestBuilder(u *url.URL) *ReqBuilder

func (*ReqBuilder) Build

func (b *ReqBuilder) Build() *http.Request

func (*ReqBuilder) WithAuth

func (b *ReqBuilder) WithAuth(username, password string) *ReqBuilder

func (*ReqBuilder) WithBody

func (b *ReqBuilder) WithBody(body io.Reader) *ReqBuilder

func (*ReqBuilder) WithCompression

func (b *ReqBuilder) WithCompression() *ReqBuilder

func (*ReqBuilder) WithContentType

func (b *ReqBuilder) WithContentType(value string) *ReqBuilder

func (*ReqBuilder) WithHeader

func (b *ReqBuilder) WithHeader(name, value string) *ReqBuilder

func (*ReqBuilder) WithJSON

func (b *ReqBuilder) WithJSON(data string) *ReqBuilder

func (*ReqBuilder) WithMethod

func (b *ReqBuilder) WithMethod(method string) *ReqBuilder

func (*ReqBuilder) WithPostForm

func (b *ReqBuilder) WithPostForm(data url.Values) *ReqBuilder

func (*ReqBuilder) WithUserAgent

func (b *ReqBuilder) WithUserAgent(value string) *ReqBuilder

func (*ReqBuilder) WithXML

func (b *ReqBuilder) WithXML(data string) *ReqBuilder

type SaveCookieError

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

func (*SaveCookieError) Error

func (e *SaveCookieError) Error() string

Jump to

Keyboard shortcuts

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