httprequest

package
v0.0.0-...-e2acaf5 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultOptions = Option{
		Timeout: time.Duration(30 * time.Second),
		Headers: http.Header{},
	}
)

Functions

This section is empty.

Types

type Chain

type Chain struct {
	interfaces.Chain
}

func Inherit

func Inherit(parent interfaces.Chain) Chain

func (Chain) Delete

func (p Chain) Delete() interfaces.Readable

type HttpRequestOptionable

type HttpRequestOptionable interface {
	WithOptions(opts ...Option) HttpRequestStartable
}

type HttpRequestProceedable

type HttpRequestProceedable interface {
	Get() interfaces.Readable
	Delete() interfaces.Readable
	Post() interfaces.Readable
	Patch() interfaces.Readable
	Put() interfaces.Readable
}

type HttpRequestStartable

type HttpRequestStartable interface {
	HttpRequestOptionable
	HttpRequestProceedable
}

type Option

type Option struct {
	Timeout time.Duration
	Headers http.Header
}

func Accept

func Accept(contentType string) Option

func Timeout

func Timeout(timeout time.Duration) Option

type Options

type Options struct {
	Option
}

func NewOptions

func NewOptions() (*Options, error)

func (*Options) Apply

func (p *Options) Apply(opt ...Option) error

Jump to

Keyboard shortcuts

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