Skip to content

Latest commit

 

History

24 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bird_socket

GoDoc Build Status Go Report Card Sourcegraph

Golang library to communicate with Bird routing daemon

Usage

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.

License

(c) Daniel Czerwonk, 2017. Licensed under MIT license.

Bird routing daemon

see http://bird.network.cz/

About

Golang library to communicate with Bird routing daemon

Topics

Resources

Stars

9 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages