Documentation ¶
Index ¶
- Constants
- func AddLogFilterForRequest(exp string, replace string) error
- 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, ...) (*bytes.Buffer, *http.Response, error)
- func ReturnRefresh(id uint64, w http.ResponseWriter, r *http.Request, httpCode int, ...)
- func SendJSON(w http.ResponseWriter, statusCode int, data interface{})
- func SetLogFilterForRequest(f *misc.Replace)
- func SetMinSizeForGzip(size int)
- func WriteContentHeader(w http.ResponseWriter, contentType string) error
- func WriteReply(w http.ResponseWriter, httpCode int, contentCode string, ...) (err error)
- type BlackHole
- type ExtraInfoFunc
- type ExtraRootItemFunc
- type HTTP
- func (h *HTTP) AddAuthHandler(ah auth.Handler) (err error)
- func (h *HTTP) AddEndpointsInfo(list misc.StringMap)
- func (h *HTTP) AddPool(name string, f PoolStatFunc)
- func (h *HTTP) CancelPathReplacing(path string)
- func (h *HTTP) File(id uint64, prefix string, path string, w http.ResponseWriter, r *http.Request) (processed bool)
- func (h *HTTP) IsPathReplaced(path string) bool
- func (h *HTTP) MenuHighlight() (open template.HTML, close template.HTML)
- func (h *HTTP) RemoveStdPath(path 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) SetStatusFunc(f StatusFunc, paramsInfo string)
- func (h *HTTP) Start() error
- func (h *HTTP) Stop() error
- type Handler
- type PoolStatFunc
- type StatusFunc
Constants ¶
View Source
const ( RequestOptionGzip = ".gzip" RequestOptionSkipTLSVerification = ".skip-tls-verification" RequestOptionBasicAuthUser = ".user" RequestOptionBasicAuthPassword = ".password" )
options with names starting with "." are used as internal parameters and are not added to query parameters
View Source
const ( // ContentTypeHTML -- ContentTypeHTML = "html" // ContentTypeCSS -- ContentTypeCSS = "css" // ContentTypeText -- ContentTypeText = "text" // ContentTypeJSON -- ContentTypeJSON = "json" // ContentTypeIcon -- ContentTypeIcon = "ico" // ContentTypeBin -- ContentTypeBin = "bin" // 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 AddLogFilterForRequest ¶ added in v0.1.8
AddLogFilterForRequest --
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, extraHeaders misc.StringMap, data []byte) (*bytes.Buffer, *http.Response, error)
Request --
func ReturnRefresh ¶
func ReturnRefresh(id uint64, w http.ResponseWriter, r *http.Request, httpCode int, forceTo string, data []byte, err error)
ReturnRefresh --
func SetLogFilterForRequest ¶ added in v0.1.8
SetLogFilterForRequest --
func WriteContentHeader ¶
func WriteContentHeader(w http.ResponseWriter, contentType string) error
WriteContentHeader --
func WriteReply ¶
func WriteReply(w http.ResponseWriter, httpCode int, contentCode string, extraHeaders misc.StringMap, data []byte) (err error)
WriteReply --
Types ¶
type HTTP ¶
type HTTP struct {
// contains filtered or unexported fields
}
HTTP --
func NewListener ¶
NewListener --
func (*HTTP) AddAuthHandler ¶ added in v0.1.57
AddAuthHandler --
func (*HTTP) AddEndpointsInfo ¶
AddEndpointsInfo --
func (*HTTP) AddPool ¶ added in v0.1.45
func (h *HTTP) AddPool(name string, f PoolStatFunc)
AddPool --
func (*HTTP) CancelPathReplacing ¶ added in v0.1.29
CancelPathReplacing --
func (*HTTP) File ¶ added in v0.1.25
func (h *HTTP) File(id uint64, prefix string, path string, w http.ResponseWriter, r *http.Request) (processed bool)
File --
func (*HTTP) IsPathReplaced ¶ added in v0.1.29
IsPathReplaced --
func (*HTTP) MenuHighlight ¶
MenuHighlight --
func (*HTTP) RemoveStdPath ¶ added in v0.1.29
RemoveStdPath --
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 --
func (*HTTP) SetStatusFunc ¶ added in v0.1.47
func (h *HTTP) SetStatusFunc(f StatusFunc, paramsInfo string)
SetStatusFunc --
type Handler ¶
type Handler interface {
Handler(id uint64, prefix string, path string, w http.ResponseWriter, r *http.Request) bool
}
Handler --
type StatusFunc ¶ added in v0.1.47
StatusFunc --
Source Files ¶
Click to show internal directories.
Click to hide internal directories.