pkg

package
v0.0.0-...-765cc39 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2018 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SharedHTTPTransport = &http.Transport{
	Proxy: http.ProxyFromEnvironment,
	DialContext: (&net.Dialer{
		Timeout:   30 * time.Second,
		KeepAlive: 30 * time.Second,
		DualStack: true,
	}).DialContext,
	MaxIdleConns:          100,
	MaxIdleConnsPerHost:   100,
	IdleConnTimeout:       90 * time.Second,
	TLSHandshakeTimeout:   10 * time.Second,
	ExpectContinueTimeout: 1 * time.Second,
}

Functions

func NewHTTPClient

func NewHTTPClient(timeout time.Duration) *http.Client

Types

type Backend

type Backend struct {
	URL    string
	Name   string
	IsMain bool
	Type   BackendType
}

type BackendType

type BackendType string
const (
	EthBackend BackendType = "ETH"
	BtcBackend BackendType = "BTC"
)

type BatchResponse

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

func NewBatchResponse

func NewBatchResponse(res http.ResponseWriter) *BatchResponse

func (*BatchResponse) Flush

func (b *BatchResponse) Flush() error

func (*BatchResponse) ResponseWriter

func (b *BatchResponse) ResponseWriter() http.ResponseWriter

type Interceptor

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

func NewInterceptor

func NewInterceptor() *Interceptor

func (*Interceptor) Body

func (w *Interceptor) Body() []byte

func (*Interceptor) Header

func (w *Interceptor) Header() http.Header

func (*Interceptor) IsOK

func (w *Interceptor) IsOK() bool

func (*Interceptor) Write

func (w *Interceptor) Write(b []byte) (int, error)

func (*Interceptor) WriteHeader

func (w *Interceptor) WriteHeader(statusCode int)

type Service

type Service interface {
	Start() error
	Stop() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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