Golang library to communicate with Bird routing daemon
The package keeps the original Query API and applies bounded defaults: a
30-second operation timeout and a 64 MiB response limit.
reply, err := birdsocket.Query("/run/bird/bird.ctl", "show status")Callers that already have a request or scrape context should use
QueryContext and set limits for their workload:
reply, err := birdsocket.QueryContext(
ctx,
"/run/bird/bird.ctl",
"show protocols all",
birdsocket.WithTimeout(5*time.Second),
birdsocket.WithMaxResponseBytes(4<<20),
)Terminal 8xxx and 9xxx replies are returned as *ReplyError.
ErrResponseTooLarge can be checked with errors.Is.
(c) Daniel Czerwonk, 2017. Licensed under MIT license.