conn

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTypeError = errors.New("type error")
	ErrUnknown   = errors.New("unknown error")
)

Functions

This section is empty.

Types

type Conn

type Conn struct {
	net.Conn

	ID int64
	// contains filtered or unexported fields
}

func (*Conn) Close

func (conn *Conn) Close() error

func (*Conn) Info

func (conn *Conn) Info() string

func (*Conn) Read

func (conn *Conn) Read(b []byte) (int, error)

func (*Conn) Write

func (conn *Conn) Write(b []byte) (int, error)

type HttpClient

type HttpClient struct {
	*http.Client

	PostCount int64
	GetCount  int64
	DoCount   int64
	ErrCount  int64
	// contains filtered or unexported fields
}

func (*HttpClient) Close

func (hc *HttpClient) Close()

func (*HttpClient) Do

func (hc *HttpClient) Do(req *http.Request) (*http.Response, error)

func (*HttpClient) Get

func (hc *HttpClient) Get(url string) (*http.Response, error)

func (*HttpClient) Info

func (hc *HttpClient) Info() string

func (*HttpClient) NRead

func (hc *HttpClient) NRead() int64

func (*HttpClient) NWrite

func (hc *HttpClient) NWrite() int64

type Pool

type Pool struct {
	ID int64
	sync.Pool
	// contains filtered or unexported fields
}

func New

func New(conf *conf.Conf, addrs []string, limit int64, retry int) *Pool

func (*Pool) Get

func (pool *Pool) Get(ctx context.Context) *Conn

func (*Pool) GetHttp

func (pool *Pool) GetHttp(ctx context.Context) (*HttpClient, error)

func (*Pool) Put

func (pool *Pool) Put(c *Conn)

Jump to

Keyboard shortcuts

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