requesting

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConnContextKey = "http-con"

Functions

func NewAddressing

func NewAddressing(lcladdr string, rmtaddr string) (addrsng *addrssing)

Types

type Addressing

type Addressing interface {
	LocalAddr() string
	RemoteAddr() string
}

type Request

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

func (*Request) Close

func (rqst *Request) Close() (err error)

func (*Request) Header

func (rqst *Request) Header(header string) (value string)

func (*Request) Headers

func (rqst *Request) Headers() (headers []string)

func (*Request) IsValid

func (rqst *Request) IsValid() (bool, error)

func (*Request) LocalAddr

func (rqst *Request) LocalAddr() (addr string)

func (*Request) Method

func (rqst *Request) Method() (prtclmthd string)

func (*Request) Parameters

func (rqst *Request) Parameters() (prms parameters.ParametersAPI)

func (*Request) Path

func (rqst *Request) Path() (path string)

func (*Request) Proto

func (rqst *Request) Proto() (prtcl string)

func (*Request) QueryString

func (rqst *Request) QueryString() (querystring string)

func (*Request) RangeOffset

func (rqst *Request) RangeOffset() (rangeoffset int64)

func (*Request) RangeType

func (rqst *Request) RangeType() (rangetype string)

func (*Request) Read

func (rqst *Request) Read(p []byte) (n int, err error)

func (*Request) ReadAll

func (rqst *Request) ReadAll() (all string, err error)

func (*Request) ReadLines

func (rqst *Request) ReadLines() (lines []string, err error)

func (*Request) ReadRune

func (rqst *Request) ReadRune() (r rune, size int, err error)

func (*Request) Readln

func (rqst *Request) Readln() (ln string, err error)

func (*Request) RemoteAddr

func (rqst *Request) RemoteAddr() (addr string)

func (*Request) Response

func (rqst *Request) Response() (rspns ResponseAPI)

type RequestAPI

type RequestAPI interface {
	QueryString() string
	Parameters() parameters.ParametersAPI
	Proto() string
	Method() string
	Path() string
	RangeType() string
	RangeOffset() int64
	Headers() []string
	Header(string) string
	RemoteAddr() string
	LocalAddr() string
	Read([]byte) (int, error)
	ReadRune() (rune, int, error)
	Readln() (string, error)
	ReadLines() ([]string, error)
	ReadAll() (string, error)
	IsValid() (bool, error)
	Close() error
	Response() ResponseAPI
}

func NewRequest

func NewRequest(rdr io.Reader, a ...interface{}) (rqstapi RequestAPI)

type RequestInvokerFunc

type RequestInvokerFunc func(rdr io.Reader, a ...interface{}) RequestAPI
var DefaultRequestInvoker RequestInvokerFunc = nil

type Requester

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

func NewRequester

func NewRequester(a ...interface{}) (rqstor *Requester)

func (*Requester) Close

func (rqstr *Requester) Close() (err error)

func (*Requester) IsValid

func (rqstr *Requester) IsValid() (valid bool, err error)

func (*Requester) Request

func (rqstr *Requester) Request() (rqst RequestAPI)

func (*Requester) Response

func (rqstr *Requester) Response() (rspns ResponseAPI)

type RequesterAPI

type RequesterAPI interface {
	Request() RequestAPI
	Response() ResponseAPI
	IsValid() (bool, error)
	Close() error
}

type RequestorHandler

type RequestorHandler interface {
	ServeREQUEST(RequesterAPI)
}

type RequestorHandlerFunc

type RequestorHandlerFunc func(RequesterAPI)

func (RequestorHandlerFunc) ServeREQUEST

func (rqstrhdnlrfnc RequestorHandlerFunc) ServeREQUEST(rqstr RequesterAPI)

type Response

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

func (*Response) Close

func (rspns *Response) Close() (err error)

func (*Response) Error

func (rspns *Response) Error() (err error)

func (*Response) Flush

func (rspns *Response) Flush()

func (*Response) Header

func (rspns *Response) Header(header string) (value string)

func (*Response) Headers

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

func (*Response) IsValid

func (rspns *Response) IsValid() (valid bool, err error)

func (*Response) Print

func (rspns *Response) Print(a ...interface{}) (err error)

func (*Response) Println

func (rspns *Response) Println(a ...interface{}) (err error)

func (*Response) SetErrNotify

func (rspns *Response) SetErrNotify(ntfyerr func(err error))

func (*Response) SetHeader

func (rspns *Response) SetHeader(header string, value string)

func (*Response) SetStatus

func (rspns *Response) SetStatus(status int)

func (*Response) Write

func (rspns *Response) Write(p []byte) (n int, err error)

type ResponseAPI

type ResponseAPI interface {
	IsValid() (bool, error)
	Headers() []string
	Header(string) string
	SetHeader(string, string)
	SetStatus(int)
	Print(...interface{}) (err error)
	Println(...interface{}) (err error)
	Write([]byte) (int, error)
	SetErrNotify(func(err error))
	Error() error
	Flush()
	Close() error
}

func NewResponse

func NewResponse(wtr io.Writer, a ...interface{}) (rspnsapi ResponseAPI)

type ResponseInvokerFunc

type ResponseInvokerFunc func(w io.Writer, a ...interface{}) ResponseAPI
var DefaultResponseInvoker ResponseInvokerFunc = nil

Jump to

Keyboard shortcuts

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