github.com/aristanetworks/goarista@v0.0.0-20240514173732-cca2755bbd44/README.md (about) 1 # Arista Go library [![Build Status](https://travis-ci.org/aristanetworks/goarista.svg?branch=master)](https://travis-ci.org/aristanetworks/goarista) [![codecov.io](http://codecov.io/github/aristanetworks/goarista/coverage.svg?branch=master)](http://codecov.io/github/aristanetworks/goarista?branch=master) [![GoDoc](https://godoc.org/github.com/aristanetworks/goarista?status.png)](https://godoc.org/github.com/aristanetworks/goarista) [![Go Report Card](https://goreportcard.com/badge/github.com/aristanetworks/goarista)](https://goreportcard.com/report/github.com/aristanetworks/goarista) 2 3 ## areflect 4 5 Helper functions to work with the `reflect` package. Contains 6 `ForceExport()`, which bypasses the check in `reflect.Value` that 7 prevents accessing unexported attributes. 8 9 ## monotime 10 11 Provides access to a fast monotonic clock source, to fill in the gap in the 12 [Go standard library, which lacks one](https://github.com/golang/go/issues/12914). 13 Don't use `time.Now()` in code that needs to time things or otherwise assume 14 that time passes at a constant rate, instead use `monotime.Now()`. 15 16 ## cmd 17 18 See the [cmd](cmd) directory. 19 20 ## dscp 21 22 Provides `ListenTCPWithTOS()`, which is a replacement for `net.ListenTCP()` 23 that allows specifying the ToS (Type of Service), to specify DSCP / ECN / 24 class of service flags to use for incoming connections. Requires `go1.9`. 25 26 ## key 27 28 Provides common types used across various Arista projects. The type `key.Key` is used to work 29 around the fact that Go can't let one use a non-hashable type as a key to a `map`. Because we 30 often use a `map[string]interface{}` (or other non-hashable type) as a key to a map, the type 31 `key.Map` is used to represent a map that can store both natively hashable and non-hashable types 32 alike. To do this, a non-hashable type must have a custom Hash() method defined. The type 33 `key.Path` is the representation of a path broken down into individual elements, where each 34 element is a `key.Key`. The type `key.Pointer` represents a pointer to a `key.Path`. 35 36 ## path 37 38 Provides functions that can be used to manipulate `key.Path` objects. The type 39 `path.Map` may be used for mapping paths to values. It allows for some fuzzy 40 matching for paths containing `path.Wildcard` keys. 41 42 ## lanz 43 A client for [LANZ](https://eos.arista.com/latency-analyzer-lanz-architectures-and-configuration/) 44 streaming servers. It connects to a LANZ streaming server, 45 listens for notifications, decodes them and sends the LANZ protobuf on the 46 provided channel. 47 48 ## monitor 49 50 A library to help expose monitoring metrics on top of the 51 [`expvar`](https://golang.org/pkg/expvar/) infrastructure. 52 53 ## netns 54 55 `netns.Do(namespace, cb)` provides a handy mechanism to execute the given 56 callback `cb` in the given [network namespace](https://lwn.net/Articles/580893/). 57 58 ## influxlib 59 60 This is a influxdb library that provides easy methods of connecting to, writing to, 61 and reading from the service. 62 63 ## test 64 65 This is a [Go](http://golang.org/) library to help in writing unit tests. 66 67 ## Examples 68 69 TBD