Documentation ¶
Index ¶
- type Band
- type Cell
- func (cell *Cell) Bind(band *Band, key string) (err error)
- func (cell *Cell) HandleHTTP(res http.ResponseWriter, req *http.Request)
- func (cell *Cell) Key() string
- func (cell *Cell) Listen()
- func (cell *Cell) ListenSig()
- func (cell *Cell) MountFunc(pattern string, callback func(http.ResponseWriter, *http.Request)) (err error)
- func (cell *Cell) Provide() (band *Band, err error)
- func (cell *Cell) Prune() (pruned int)
- func (cell *Cell) SendSig(sig Sig)
- func (cell *Cell) Unmount() (err error)
- func (cell *Cell) Uuid() string
- type Sig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Band ¶
type Band struct {
// contains filtered or unexported fields
}
func (*Band) Close ¶
func (band *Band) Close()
Close marks the band as closed, and ensures that the underlying socket is * also closed.
func (*Band) ReadParseFrame ¶
ReadParseFrame reads a single frame and parses it, separating the kind and * the data.
func (*Band) TryLock ¶
TryLock attempts to lock the band, and returns whether it succeeded or not. * A mutex is not used because if this function were blocking, a request might * have to wait for a huge file download to complete before being given a band.
type Cell ¶
type Cell struct { Reader *fsock.Reader Writer *fsock.Writer // contains filtered or unexported fields }
Cell represents a connection to a cell server. It should only be created in * response to an incoming tls connection, using the Handle function.
func (*Cell) HandleHTTP ¶
func (cell *Cell) HandleHTTP( res http.ResponseWriter, req *http.Request, )
HandleHTTP handles an http request directed at this cell. It selects a free * band, and then uses it to inform the cell of a new request and it pipes the * response back to the client.
func (*Cell) Listen ¶
func (cell *Cell) Listen()
listen listens for incoming data on the socket, and uses it to fulfill
* requests.
func (*Cell) MountFunc ¶
func (cell *Cell) MountFunc( pattern string, callback func(http.ResponseWriter, *http.Request), ) ( err error, )
MountFunc is, for now, a wrapper around HolaMux.MountFunc().
func (*Cell) Provide ¶
Provide returns an unlocked band that is not currently being used. If it * can't find one, it puts in a request for one and waits until it is available. * The band must be manually re-locked after use! (except on error)
func (*Cell) Prune ¶
Prune removes bands that haven't been used in a while, or have been marked as * closed.