Documentation
¶
Index ¶
- Variables
- type Factory
- func (f *Factory) CONNECT(v ...Option) Func
- func (f *Factory) DELETE(v ...Option) Func
- func (f *Factory) GET(v ...Option) Func
- func (f *Factory) HEAD(v ...Option) Func
- func (f *Factory) New(method string, options ...Option) Func
- func (f *Factory) OPTIONS(v ...Option) Func
- func (f *Factory) PATCH(v ...Option) Func
- func (f *Factory) POST(v ...Option) Func
- func (f *Factory) PUT(v ...Option) Func
- func (f *Factory) TRACE(v ...Option) Func
- type Func
- func CONNECT(v ...Option) Func
- func DELETE(v ...Option) Func
- func GET(v ...Option) Func
- func HEAD(v ...Option) Func
- func New(method string, options ...Option) Func
- func OPTIONS(v ...Option) Func
- func PATCH(v ...Option) Func
- func POST(v ...Option) Func
- func PUT(v ...Option) Func
- func TRACE(v ...Option) Func
- type Option
- func BaseUrl(v string) Option
- func Body(v *io.Reader) Option
- func BodyBytes(v []byte) Option
- func BodyString(v string) Option
- func Context(v context.Context) Option
- func Cookie(v *http.Cookie) Option
- func Header(k, v string) Option
- func Host(v string) Option
- func Path(v string, args ...interface{}) Option
- func Port(v int) Option
- func PortString(v string) Option
- func Query(k, v string) Option
- func Scheme(v string) Option
Constants ¶
This section is empty.
Variables ¶
var DefaultFactory = NewFactory()
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory is a struct that holds default options for creating HTTP requests.
func NewFactory ¶
NewFactory creates a new Factory with the given default options.
func (*Factory) CONNECT ¶
CONNECT creates a new HTTP CONNECT request function with the specified options.
func (*Factory) DELETE ¶
DELETE creates a new HTTP DELETE request function with the specified options.
func (*Factory) New ¶
New creates a new HTTP request function with the specified method and options.
func (*Factory) OPTIONS ¶
OPTIONS creates a new HTTP OPTIONS request function with the specified options.
type Func ¶
Func is a type alias for a function that takes a *testing.T and returns an *http.Request.
type Option ¶
type Option = func(*builder)
Option is a function that modifies the builder.
func BodyString ¶
BodyString sets the body of the request from a string.
func PortString ¶
PortString sets the port for the request as a string.