Giter Club home page Giter Club logo

go-birdc's Introduction

(Français)

go-birdc

This is a GO library for working with the BIRD internet routing daemon through the provided unix domain socket. It is primarily an abstraction layer allowing users to communicate with a BIRD daemon without needing to directly talk with the BIRD daemon or spawn goroutines to issue birdc commands and parsing the output.

Usage

Install the library as a dependency

go get -u github.com/StatCan/go-birdc@latest

Then start using it in your application

import "github.com/StatCan/go-birdc"

func main() {
	b := New() // optionally you can specify a path to the unix socket endpoint (defaults to: /run/bird/bird.ctl)
	resp, replyCode, err := b.ShowStatus()
	if err != nil {
		log.Fatalf("something went wrong. %s", replyCode)
	}

	resp, replyCode, err := b.RestartProtocol("bgp")
	if err != nil {
		log.Fatalf("somthing went wrong. %s", replyCode)
	}

	fmt.Println(string(resp))
}

Related Documentation

How to Contribute

See CONTRIBUTING.md

License

Unless otherwise noted, the source code of this project is covered under Crown Copyright, Government of Canada, and is distributed under the MIT License.

The Canada wordmark and related graphics associated with this distribution are protected under trademark law and copyright law. No permission is granted to use them outside the parameters of the Government of Canada's corporate identity program. For more information, see Federal identity requirements.


go-birdc

Voici une bibliothèque GO pour travailler avec le démon de routage internet BIRD via le socket de domaine Unix fourni. Il s'agit principalement d'une couche d'abstraction permettant aux utilisateurs de communiquer avec un démon BIRD sans avoir besoin de dialoguer directement avec le démon BIRD ou de lancer des goroutines pour émettre des commandes birdc et analyser la sortie.

Utilisation

Installer la bibliothèque en tant que dépendance.

go get -u github.com/StatCan/go-birdc@latest

Ensuite, commencez à l'utiliser dans votre application.

import "github.com/StatCan/go-birdc"

func main() {
	b := New() // optionally you can specify a path to the unix socket endpoint (defaults to: /run/bird/bird.ctl)
	resp, replyCode, err := b.ShowStatus()
	if err != nil {
		log.Fatalf("something went wrong. %s", replyCode)
	}

	resp, replyCode, err := b.RestartProtocol("bgp")
	if err != nil {
		log.Fatalf("somthing went wrong. %s", replyCode)
	}

	fmt.Println(string(resp))
}

Documentation Connexe

Comment contribuer

Voir CONTRIBUTING.md

Licence

Sauf indication contraire, le code source de ce projet est protégé par le droit d'auteur de la Couronne du gouvernement du Canada et distribué sous la licence MIT.

Le mot-symbole « Canada » et les éléments graphiques connexes liés à cette distribution sont protégés en vertu des lois portant sur les marques de commerce et le droit d'auteur. Aucune autorisation n'est accordée pour leur utilisation à l'extérieur des paramètres du programme de coordination de l'image de marque du gouvernement du Canada. Pour obtenir davantage de renseignements à ce sujet, veuillez consulter les Exigences pour l'image de marque.

go-birdc's People

Contributors

systemfiles avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.