http_v2_client

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const CR = '\r'
View Source
const CRLF = "\r\n"
View Source
const LF = '\n'

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

type Chunk struct {
	LenByte               bytes.Buffer
	Len                   int64
	BoundaryAndParameters bytes.Buffer
	Body                  bytes.Buffer
	ReceivedLen           int64
}

func NewChunk

func NewChunk() *Chunk

type HttpV2Client

type HttpV2Client struct {
	Protocol string
	Host     string
	Port     int
	Path     string
	Timeout  time.Duration
	TcpConn  net.Conn
	// contains filtered or unexported fields
}

func NewHttpV2Client

func NewHttpV2Client(Host string, Port int, opts ...Option) *HttpV2Client

func (*HttpV2Client) CheckConnection

func (c *HttpV2Client) CheckConnection() error

func (*HttpV2Client) Close

func (c *HttpV2Client) Close() error

func (*HttpV2Client) Connect

func (c *HttpV2Client) Connect() error

func (*HttpV2Client) GetReceivedChunkChannel

func (c *HttpV2Client) GetReceivedChunkChannel() chan Chunk

func (*HttpV2Client) GetReceivedHttpHeaderChannel

func (c *HttpV2Client) GetReceivedHttpHeaderChannel() chan string

func (*HttpV2Client) Receive

func (c *HttpV2Client) Receive()

func (*HttpV2Client) SendHeaders

func (c *HttpV2Client) SendHeaders(headers []string) error

func (*HttpV2Client) SendMultiPart

func (c *HttpV2Client) SendMultiPart(parameters []string, body []byte) error

func (*HttpV2Client) SendMultiPartEnd

func (c *HttpV2Client) SendMultiPartEnd() error

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithBoundary

func WithBoundary(s string) Option

func WithPath

func WithPath(s string) Option

func WithProtocol

func WithProtocol(s string) Option

Jump to

Keyboard shortcuts

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