github.com/aristanetworks/goarista/lanz

Fairly general building blocks used in Arista Go code and open-sourced for the benefit of all.


License
Other
Install
go get github.com/aristanetworks/goarista/lanz

Documentation

Arista Go library Build Status codecov.io GoDoc Go Report Card

areflect

Helper functions to work with the reflect package. Contains ForceExport(), which bypasses the check in reflect.Value that prevents accessing unexported attributes.

atime

Provides access to a fast monotonic clock source, to fill in the gap in the Go standard library, which lacks one. Don't use time.Now() in code that needs to time things or otherwise assume that time passes at a constant rate, instead use atime.Nanotime().

cmd

occli

Simple CLI client for the OpenConfig gRPC interface that prints the response protobufs in text form or JSON.

ockafka

Client for the OpenConfig gRPC interface that publishes updates to Kafka.

ocredis

Client for the OpenConfig gRPC interface that publishes updates to Redis using both Redis' hashes (one per container / entity / collection) and Redis' Pub/Sub mechanism, so that one can subscribe to incoming updates being applied on the hash maps.

dscp

Provides ListenTCPWithTOS(), which is a replacement for net.ListenTCP() that allows specifying the ToS (Type of Service), to specify DSCP / ECN / class of service flags to use for incoming connections.

key

Provides a common type used across various Arista projects, named key.Key, which is used to work around the fact that Go can't let one use a non-hashable type as a key to a map, and we sometimes need to use a map[string]interface{} (or something containing one) as a key to maps. As a result, we frequently use map[key.Key]interface{} instead of just map[interface{}]interface{} when we need a generic key-value collection.

monitor

A library to help expose monitoring metrics on top of the expvar infrastructure.

netns

netns.Do(namespace, cb) provides a handy mechanism to execute the given callback cb in the given network namespace.

test

This is a Go library to help in writing unit tests.

Examples

TBD