rehttp

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2018 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ContentTypeJson = ContentType("application/json")
	ConentTypeXML   = ContentType("application/xml")
	ContentTypeHTML = ContentType("text/html")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Before

type Before func(b Builder, path string, body []byte)

type Builder

type Builder interface {
	Balancer(bln balancer.Balancer) Builder
	Logger(logger logging.Logger) Builder
	DecodeType(contentType ContentType) Builder
	Service(name string) Builder
	Address(address string) Builder
	GET(path string) Builder
	POST(path string) Builder
	PUT(path string) Builder
	DELETE(path string) Builder
	PATCH(path string) Builder
	OPTIONS(path string) Builder
	QueryParam(key, value string) Builder
	ToEncode(object interface{}) Builder
	ToDecode(object interface{}) Builder
	ContentType(contentType ContentType) Builder
	Header(key, value string) Builder
	Cookie(key string, value []byte) Builder
	Encoder(encoder serialization.Encoder) Builder
	Decoder(decoder serialization.Decoder) Builder
	Before(fn Before) Builder
	Go() (response Response, err error)
}

type ContentType

type ContentType string

func (ContentType) String

func (ct ContentType) String() string

type Factory

type Factory interface {
	To(address string) Builder
	Service(name string) Builder
}

type Response

type Response interface {
	Status() (code int)
	Decoded() (decoded interface{})
	ContentType() (contentType ContentType)
	Header(key string) (values []string)
	Body() (data []byte)
	Error() (err error)
}

Jump to

Keyboard shortcuts

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