web

package
v0.0.0-...-3f97f43 Latest Latest
Warning

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

Go to latest
Published: May 28, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client - struct

var DefaultClient *Client

DefaultClient - default global web Client

func NewClient

func NewClient() (clnt *Client)

NewClient - instance

func (*Client) Close

func (clnt *Client) Close()

Close *Client

func (*Client) Do

func (clnt *Client) Do(rqst *http.Request) (rspnse *http.Response, err error)

Do - refer tp http.Client Do interface

func (*Client) Send

func (clnt *Client) Send(rqstpath string, a ...interface{}) (rspr iorw.Reader, err error)

Send - Client send

func (*Client) SendReceive

func (clnt *Client) SendReceive(rqstpath string, a ...interface{}) (rw ReaderWriter, err error)

SendReceive return ReaderWriter that implement io.Reader,io.Writer

func (*Client) SendRespondString

func (clnt *Client) SendRespondString(rqstpath string, a ...interface{}) (rspstr string, err error)

SendRespondString - Client Send but return response as string

type ClientHandle

type ClientHandle struct {
	*Client
	SendReceive       func(rqstpath string, a ...interface{}) (rw ReaderWriter, err error)
	SendRespondString func(rqstpath string, a ...interface{}) (rspstr string, err error)
	Send              func(rqstpath string, a ...interface{}) (rspr iorw.Reader, err error)
	Close             func()
}

type ReaderWriter

type ReaderWriter interface {
	iorw.PrinterReader
	io.ReadWriteCloser
	Flush() error
}

ReaderWriter interface

type Response

type Response struct {
	Status     string // e.g. "200 OK"
	StatusCode int    // e.g. 200
	Proto      string // e.g. "HTTP/1.0"
	// contains filtered or unexported fields
}

func (*Response) Cookies

func (rspns *Response) Cookies() (cookies []*http.Cookie)

func (*Response) Header

func (rspns *Response) Header(hdr string) (val string)

func (*Response) Headers

func (rspns *Response) Headers() (headers []string)

func (*Response) Reader

func (rspns *Response) Reader() (rdr *iorw.EOFCloseSeekReader)

Jump to

Keyboard shortcuts

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