Documentation ¶
Overview ¶
Package bird provides Bird protocol client and server implementations.
Index ¶
Constants ¶
View Source
const ( // DefaultPort is the default Bird port for TCP. DefaultPort uint16 = 6668 )
Variables ¶
View Source
var ( // ErrNoHostURL indicates that the URL given was missing the host. ErrNoHostURL = errors.New("URL should have host") // ErrProtocolRelativeURL indicates that the URL given was not relative to // the bird:// scheme. ErrProtocolRelativeURL = errors.New("URL should be protocol relative and have no scheme") // ErrTrailingSlashURL indicates that the URL given had a trailing slash, // which is not allowed in the Bird protocol. ErrTrailingSlashURL = errors.New("URL should not have trailing slash") )
Functions ¶
func Fetch ¶
Fetch fetches the requested Seed document using Bird.
rawurl is a Bird URL that is protocol-relative and without a trailing slash. bird://hello/world/ is simply //hello/world.
sr is the Seed document reader, close is a function that closes the underlying connection and err is any error in creating a connection to the Bird server.
Types ¶
type Handler ¶
Handler responds to a Bird request.
ServeBird writes a Seed document to sw in response to the request URL u.
type HandlerFunc ¶
HandlerFunc is a Handler that allows you to use a function to handle Bird requests.
f := func(u *url.URL, sw *seed.Writer) { sw.Text("Hello, world!") } h := bird.HandlerFunc(f) bird.Serve(..., h)
f is type converted to a HandlerFunc here and is used as a Handler.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
eagle
Command eagle makes Bird protocol requests.
|
Command eagle makes Bird protocol requests. |
owl
Command owl starts a basic Bird protocol file server using owl.FileServer for the directory it is run in.
|
Command owl starts a basic Bird protocol file server using owl.FileServer for the directory it is run in. |
Package owl provides an implementation of a file server for the Bird protocol.
|
Package owl provides an implementation of a file server for the Bird protocol. |
Package seed reads and writes Seed documents.
|
Package seed reads and writes Seed documents. |
Click to show internal directories.
Click to hide internal directories.