Documentation ¶
Index ¶
- type Cell
- func (cell *Cell) RegisterDir(dirPath string, webPath string, active bool) (err error)
- func (cell *Cell) RegisterFile(filePath string, webPath string, autoReload bool) (err error)
- func (cell *Cell) Run()
- func (cell *Cell) SetCacheMaxAge(maxAge time.Duration)
- func (cell *Cell) Stop()
- func (cell *Cell) UnregisterDir(webPath string) (err error)
- func (cell *Cell) UnregisterFile(webPath string) (err error)
- type HTTPReqHead
- type HTTPRequest
- type HTTPResponse
- type Mount
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cell ¶
type Cell struct { Description string MountPoint Mount DataDirectory string QueenAddress string Key string RootCertPath string OnHTTP func(response *HTTPResponse, request *HTTPRequest) OnSetup func(cell *Cell) OnStop func() // contains filtered or unexported fields }
func (*Cell) RegisterDir ¶
RegisterDir registers a directory located at the directory path on the * specific url path.
func (*Cell) RegisterFile ¶
RegisterFile registers a file located at the filepath on the specific url * path.
func (*Cell) SetCacheMaxAge ¶ added in v0.5.0
SetCacheMaxAge sets the max age field of the cache-control header returned * when reponding to an HTTPS request with registered files.
func (*Cell) Stop ¶ added in v0.4.0
func (cell *Cell) Stop()
Stop closes the cell's leash, and all bands in it, preventing the leash from * reconnecting if it is ensured.
func (*Cell) UnregisterDir ¶
UnregisterDir finds the directory registered at the specified url path and * unregisters it, freeing it from memory
func (*Cell) UnregisterFile ¶
UnregisterFile finds the file registered at the specified url path and * unregisters it, freeing it from memory
type HTTPReqHead ¶
type HTTPReqHead protocol.FrameHTTPReqHead
type HTTPRequest ¶
type HTTPRequest struct { Head *protocol.FrameHTTPReqHead // contains filtered or unexported fields }
HTTPRequest stores information about an HTTP request, and has functions for * reading it's request body.
func (*HTTPRequest) ReadBody ¶
func (request *HTTPRequest) ReadBody() (getNext bool, data []byte, err error)
ReadBody reads a chunk of the request body. This function returns true for * getNext if the chunk was successfully read, and false if it encountered an * error or the request ended.
func (*HTTPRequest) ReadBodyFull ¶
func (request *HTTPRequest) ReadBodyFull() (data []byte, err error)
ReadHTTPBodyFull reads all chunks of the request body, and returns the data * read as []byte.
func (*HTTPRequest) SetMaxBodySize ¶
func (request *HTTPRequest) SetMaxBodySize(maxSize int)
SetMaxBodySize sets the maximum size for the request body to be sent to the * cell. Defaults to 8192 bytes. This function should usually be called before * reading the request body.
type HTTPResponse ¶
type HTTPResponse struct {
// contains filtered or unexported fields
}
HTTPResponse stores information about an HTTP response, and has function for * writing its response body
func (*HTTPResponse) WriteBody ¶
func (response *HTTPResponse) WriteBody(data []byte) (err error)
WriteBody writes a chunk of the response body.