Documentation ¶
Index ¶
- type Band
- func (band *Band) AskForHTTPBody(maxSize int) (nn int, err error)
- func (band *Band) Close()
- func (band *Band) ReadHTTPBody() (getNext bool, data []byte, err error)
- func (band *Band) ReadHTTPBodyFull() (body []byte, err error)
- func (band *Band) ReadParseFrame() (kind protocol.FrameKind, data []byte, err error)
- func (band *Band) WriteHTTPBody(data []byte) (nn int, err error)
- func (band *Band) WriteHTTPHead(code int, headers map[string][]string) (nn int, err error)
- func (band *Band) WriteMarshalFrame(frame protocol.Frame) (nn int, err error)
- type Leash
- func (leash *Leash) Close()
- func (leash *Leash) Dial(address string, key string, rootCertPath string) (err error)
- func (leash *Leash) Ensure(address string, mount Mount, key string, rootCertPath string)
- func (leash *Leash) Listen() (err error)
- func (leash *Leash) Mount(host string, path string) (err error)
- func (leash *Leash) NewBand() (err error)
- func (leash *Leash) OnHTTP(callback func(band *Band, head *protocol.FrameHTTPReqHead))
- func (leash *Leash) Stop()
- func (leash *Leash) Unmount(host string, path string) (err error)
- type Mount
- type Req
- type ReqKind
- type ReqMount
- type ReqUnmount
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) AskForHTTPBody ¶
AskForHTTPBody requests the http body data from the queen. The queen will * return at maximum the amount of data specified with maxSize.
func (*Band) Close ¶
func (band *Band) Close()
Close closes the connection and marks the band as closed so that it can be * removed from the list later.
func (*Band) ReadHTTPBody ¶
ReadHTTPBody 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 (*Band) ReadHTTPBodyFull ¶
ReadHTTPBodyFull reads all chunks of the request body, and returns the data * read as []byte.
func (*Band) ReadParseFrame ¶
ReadParseFrame reads a single frame and parses it, separating the kind and * the data.
func (*Band) WriteHTTPBody ¶
WriteHTTPBody writes a chunk of the response body.
func (*Band) WriteHTTPHead ¶
WriteHTTPHead writes HTTP header information. It should only be called once * when serving an HTTP response.
type Leash ¶
type Leash struct {
// contains filtered or unexported fields
}
Leash represents a connection to the server. Through it, the cell and the * server can communicate. Leashes are associated with a number of bands, which * are automatically created and destroyed as needed.
func NewLeash ¶
func NewLeash() (leash *Leash)
NewLeash creates a new leash object. It does not connect the leash to a * server, this needs to be done via the Ensure() or Dial() function.
func (*Leash) Close ¶
func (leash *Leash) Close()
Close closes the leash, and all bands in it. If the connection is ensured, * this will just re-connect afterwards. To stop this from happening, call the * Stop() method instead.
func (*Leash) Dial ¶
Dial connects the leash to a server. This function is only useful in some * cases, Ensure is usually a better option.
func (*Leash) Ensure ¶
This is generally the function you will call to make a connection to a * server, except in some specific use cases. It automatically reconnects the * leash whenever the server goes offline and then back online again. This * function should generally be run in main() or in a separate goroutine. It * does not return.
func (*Leash) Mount ¶
Mount tells the leash to mount on a particular pattern. This function is * thread safe.
func (*Leash) NewBand ¶
NewBand Creates a new band specifically for this leash, and adds it to the * list of bands.
func (*Leash) OnHTTP ¶
func (leash *Leash) OnHTTP( callback func(band *Band, head *protocol.FrameHTTPReqHead), )
OnHTTP specifies the http request handler function for the leash.
type ReqUnmount ¶
func (*ReqUnmount) Kind ¶
func (req *ReqUnmount) Kind() ReqKind