package
0.0.0-20190730192424-891f3ce14ace
Repository: https://github.com/csunetsec/bgpmon.git
Documentation: pkg.go.dev

# Functions

CheckForKeys checks a map[string]string for the existence of all string keys provided.
DisableLogging reroutes all created loggers to a nil output.
GetAdvertisedPrefixes returns the advertised routes as a slice of IPNet and possibly an error from a protobuf capture.
GetASPath returns an Autonomous System path as an array of integers from a protobuf capture.
GetIPNetsAsPrefixList returns []*PrefixWrapper from a []*net.IPNet.
GetIPWrapper returns a net.IP and possibly an error from the protobuf IP address wrapper.
GetNextHop returns the IP and possibly an error of the next hop from a protobuf capture.
GetOriginAS returns the origin AS as an integer (the AS at the last index of the AS-Path) of the ASPath from a capture or possibly an error.
GetPeerIP returns a PeerIP and possibly and error from a protobuf capture.
GetPrefixListAsIPNet returns the slice of IPNet and possibly an error from a slice of protobuf PrefixWrapper.
GetProtoMsg returns a byte array representing the capture from a protobuf capture.
GetTimeColIP returns the time of the capture, the collector IP and possibly an error from a protobuf BGP capture.
GetWithdrawnPrefixes returns the withdrawn routes as a slice of IPNet and possibly an error from a protobuf capture.
IsClosed returns true if a context has been closed, false otherwise.
NewInsertBuffer returns a SQLBuffer which buffers values for an insert statement.
NewLogger returns a util.Logger, with pairs of strings matched for fields.
NewTimedBuffer returns a TimedBuffer that expires after duration d.
OptMapToString is a function that turns a map[string]string to a string like "-key1 val1 -key2 val2".
PrefixesToPQArray handles a strange case where protobuf deserialize an array element of nil as "<nil>" and that kills the db insert statement cause it can't make it into a cidr.
SanitizeDBString removes any characters from s that might be intended for a SQL injection attack.
StringToOptMap is a function that will turn a string in the form "-opt1 val1 -opt2 val2" to a map[string]string with key:values like opt1:val1, opt2:val2.

# Variables

ErrNilCap is returned when an invalid capture is passed.
ErrNilPrefWrap is returned when an IPWrapper is nil.
ErrNoAdvertisedPrefixes is returned when a capture has no advertized prefixes.
ErrNoASPath is returned when a capture has no AS path.
ErrNoIP is returned when a IPWrapper can't be parsed.
ErrNoWithdrawnPrefixes is returned when a capture has no withdrawn prefixes.
ErrOpt is returned by StringToOptMap on failure.

# Structs

InsertBuffer Represents the VALUES() array for an insert statement.
Logger is a simple wrapper around logrus.FieldLogger which eases use and adds some functionality.
TimedBuffer is a SQLBuffer that wraps another SQLBuffer, flushing it after a certain amount of time.
Timespan represents a start and end time.

# Interfaces

AtomicSQLExecutor is a SQLExecutor that can be committed or rolled back.
GetTimeouter is an interface to describe anything that expires after a certain amount of time.
SQLBuffer is an interface used to describe anything that can buffer SQL values to be flushed later.
SQLExecutor is a wrapper around sql.Tx, sql.Db, and others we implement.