Documentation ¶
Index ¶
- Constants
- func CloneURLvalues(src url.Values) (dst url.Values)
- func ContentHeader(contentType string) (string, error)
- func Error(id uint64, answerSent bool, w http.ResponseWriter, httpCode int, ...)
- func ReadData(header http.Header, body io.ReadCloser) (bodyBuf *bytes.Buffer, code int, err error)
- func ReadRequestBody(r *http.Request) (bodyBuf *bytes.Buffer, code int, err error)
- func Request(method string, uri string, timeout int, opts misc.StringMap, data []byte) (*bytes.Buffer, error)
- func ReturnRefresh(w http.ResponseWriter, r *http.Request, code int)
- func SendJSON(w http.ResponseWriter, statusCode int, data interface{})
- func WriteContentHeader(w http.ResponseWriter, contentType string) error
- func WriteReply(w http.ResponseWriter, httpCode int, contentCode string, data []byte, ...) (err error)
- type BlackHole
- type ExtraInfoFunc
- type ExtraRootItemFunc
- type HTTP
- func (h *HTTP) AddEndpointsInfo(list misc.StringMap)
- func (h *HTTP) MenuHighlight() (string, string)
- func (h *HTTP) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (h *HTTP) SetExtraInfoFunc(f ExtraInfoFunc)
- func (h *HTTP) SetName(name string, description string)
- func (h *HTTP) SetRootItemsFunc(f ExtraRootItemFunc)
- func (h *HTTP) Start() error
- func (h *HTTP) Stop() error
- type Handler
Constants ¶
View Source
const ( RequestOptionGzip = ".gzip" RequestOptionSkipTLSVerification = ".skip-tls-verification" )
options with names starting with "." are used as internal parameters and are not added to query parameters
View Source
const ( // ContentTypeIcon -- ContentTypeIcon = "icon" // ContentTypeText -- ContentTypeText = "text" // ContentTypeJSON -- ContentTypeJSON = "json" // MethodGET -- MethodGET = "GET" // MethodPOST -- MethodPOST = "POST" // MethodHEAD -- MethodHEAD = "HEAD" // MethodPUT -- MethodPUT = "PUT" // MethodDELETE -- MethodDELETE = "DELETE" // MethodCONNECT -- MethodCONNECT = "CONNECT" // MethodOPTIONS -- MethodOPTIONS = "OPTIONS" // MethodTRACE -- MethodTRACE = "TRACE" // MethodPATCH -- MethodPATCH = "PATCH" )
Variables ¶
This section is empty.
Functions ¶
func Error ¶
func Error(id uint64, answerSent bool, w http.ResponseWriter, httpCode int, message string, err error)
Error --
func ReadRequestBody ¶
ReadRequestBody --
func Request ¶
func Request(method string, uri string, timeout int, opts misc.StringMap, data []byte) (*bytes.Buffer, error)
Request -- Don't forget call bufpool.PutBuf(returned_buf)
func ReturnRefresh ¶
func ReturnRefresh(w http.ResponseWriter, r *http.Request, code int)
ReturnRefresh --
func WriteContentHeader ¶
func WriteContentHeader(w http.ResponseWriter, contentType string) error
WriteContentHeader --
func WriteReply ¶
func WriteReply(w http.ResponseWriter, httpCode int, contentCode string, data []byte, minSizeForGzip int) (err error)
WriteReply --
Types ¶
type HTTP ¶
type HTTP struct {
// contains filtered or unexported fields
}
HTTP --
func NewListener ¶
NewListener --
func (*HTTP) AddEndpointsInfo ¶
AddEndpointsInfo --
func (*HTTP) ServeHTTP ¶
func (h *HTTP) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP --
func (*HTTP) SetExtraInfoFunc ¶
func (h *HTTP) SetExtraInfoFunc(f ExtraInfoFunc)
SetExtraInfoFunc --
func (*HTTP) SetRootItemsFunc ¶
func (h *HTTP) SetRootItemsFunc(f ExtraRootItemFunc)
SetRootItemsFunc --
Click to show internal directories.
Click to hide internal directories.