Documentation ¶
Index ¶
- Constants
- Variables
- func GetID(i DBObject) (string, error)
- type ArangoConfig
- type ArangoConn
- func (a *ArangoConn) CheckExistingEPENode(local_bgp_id string) bool
- func (a *ArangoConn) CheckExistingL3VPNNode(router_ip string) bool
- func (a *ArangoConn) CheckExistingL3VPNRouter(router_ip string) bool
- func (a *ArangoConn) CreateAdjacencyList(key string, adjacency_sid string, flags string, weight string)
- func (a *ArangoConn) Delete(i DBObject) error
- func (a *ArangoConn) GetExistingPeerIP(local_bgp_id string) []string
- func (a *ArangoConn) GetExistingVPNRDS(router_ip string) []string
- func (a *ArangoConn) GetSIDIndex(ip string) string
- func (a *ArangoConn) Insert(i DBObject) error
- func (a *ArangoConn) Query(q string, bind map[string]interface{}, obj interface{}) ([]interface{}, error)
- func (a *ArangoConn) QueryOnObject(obj DBObject, ret interface{}, operators map[string]string) ([]interface{}, error)
- func (a *ArangoConn) Read(i DBObject) error
- func (a *ArangoConn) Update(i DBObject) error
- func (a *ArangoConn) UpdateExistingPeerIP(local_bgp_id string, peer_ip string)
- func (a *ArangoConn) UpdateExistingVPNRDS(router_ip string, vpn_rd string)
- func (a *ArangoConn) Upsert(i DBObject) error
- func (a *ArangoConn) UpsertSafe(i DBObject) error
- type DBObject
- type Database
- type EPELink
- type EPENode
- type EPEPrefix
- type EdgeObject
- type L3VPNNode
- type L3VPNPrefix
- type LSLink
- type LSNode
- type Router
Constants ¶
View Source
const EPELinkName = "EPELink"
View Source
const EPENodeName = "EPENode"
View Source
const EPEPrefixName = "EPEPrefix"
View Source
const L3VPNNodeName = "L3VPNNode"
View Source
const L3VPNPrefixName = "L3VPNPrefix"
View Source
const LSLinkName = "LSLink"
View Source
const LSNodeName = "LSNode"
View Source
const RouterName = "Routers"
Variables ¶
View Source
var ( ErrEmptyConfig = errors.New("ArangoDB Config has an empty field") ErrUpSafe = errors.New("Failed to UpdateSafe. Requires *DBObjects") ErrNilObject = errors.New("Failed to operate on NIL object") ErrNotFound = errors.New("Document not found") )
View Source
var ( ErrKeyInvalid = errors.New("Error: Key value is invalid") ErrKeyChange = errors.New("Error: Key value changed") )
View Source
var (
ErrCollectionNotFound = fmt.Errorf("Could not find collection")
)
Functions ¶
Types ¶
type ArangoConfig ¶
type ArangoConfig struct { URL string `desc:"Arangodb server URL (http://127.0.0.1:8529)"` User string `desc:"Arangodb server username"` Password string `desc:"Arangodb server user password"` Database string `desc:"Arangodb database name"` }
func NewConfig ¶
func NewConfig() ArangoConfig
type ArangoConn ¶
type ArangoConn struct {
// contains filtered or unexported fields
}
func NewArango ¶
func NewArango(cfg ArangoConfig) (*ArangoConn, error)
func (*ArangoConn) CheckExistingEPENode ¶
func (a *ArangoConn) CheckExistingEPENode(local_bgp_id string) bool
func (*ArangoConn) CheckExistingL3VPNNode ¶
func (a *ArangoConn) CheckExistingL3VPNNode(router_ip string) bool
func (*ArangoConn) CheckExistingL3VPNRouter ¶
func (a *ArangoConn) CheckExistingL3VPNRouter(router_ip string) bool
func (*ArangoConn) CreateAdjacencyList ¶
func (a *ArangoConn) CreateAdjacencyList(key string, adjacency_sid string, flags string, weight string)
func (*ArangoConn) Delete ¶
func (a *ArangoConn) Delete(i DBObject) error
func (*ArangoConn) GetExistingPeerIP ¶
func (a *ArangoConn) GetExistingPeerIP(local_bgp_id string) []string
func (*ArangoConn) GetExistingVPNRDS ¶
func (a *ArangoConn) GetExistingVPNRDS(router_ip string) []string
func (*ArangoConn) GetSIDIndex ¶
func (a *ArangoConn) GetSIDIndex(ip string) string
func (*ArangoConn) Insert ¶
func (a *ArangoConn) Insert(i DBObject) error
Interfaces must set their own key if they want to manage their own keys
func (*ArangoConn) Query ¶
func (a *ArangoConn) Query(q string, bind map[string]interface{}, obj interface{}) ([]interface{}, error)
func (*ArangoConn) QueryOnObject ¶
func (a *ArangoConn) QueryOnObject(obj DBObject, ret interface{}, operators map[string]string) ([]interface{}, error)
This function does not support complex types, []string does not work. Router.Interface specifically
func (*ArangoConn) Read ¶
func (a *ArangoConn) Read(i DBObject) error
func (*ArangoConn) Update ¶
func (a *ArangoConn) Update(i DBObject) error
func (*ArangoConn) UpdateExistingPeerIP ¶
func (a *ArangoConn) UpdateExistingPeerIP(local_bgp_id string, peer_ip string)
func (*ArangoConn) UpdateExistingVPNRDS ¶
func (a *ArangoConn) UpdateExistingVPNRDS(router_ip string, vpn_rd string)
func (*ArangoConn) Upsert ¶
func (a *ArangoConn) Upsert(i DBObject) error
func (*ArangoConn) UpsertSafe ¶
func (a *ArangoConn) UpsertSafe(i DBObject) error
type Database ¶
type Database interface { Insert(DBObject) error Update(DBObject) error Upsert(DBObject) error UpsertSafe(DBObject) error Read(DBObject) error Delete(DBObject) error Query(string, map[string]interface{}, interface{}) ([]interface{}, error) QueryOnObject(DBObject, interface{}, map[string]string) ([]interface{}, error) }
Database is the interface definition of a database object
type EPELink ¶
type EPELink struct { Key string `json:"_key,omitempty"` RouterID string `json:"RouterID,omitempty"` ASN string `json:"ASN,omitempty"` PeerRouterID string `json:"PeerRouterID,omitempty"` LocalInterfaceIP string `json:"LocalInterfaceIP,omitempty"` PeerIP string `json:"PeerIP,omitempty"` Protocol string `json:"Protocol,omitempty"` LocalPref string `json:"LocalPref,omitempty"` MED string `json:"MED,omitempty"` Nexthop string `json:"Nexthop,omitempty"` EPELabel string `json:"EPELabel,omitempty"` }
type EPENode ¶
type EPEPrefix ¶
type EPEPrefix struct { Key string `json:"_key,omitempty"` Prefix string `json:"Prefix,omitempty"` Length string `json:"Length,omitempty"` PeerIP string `json:"PeerIP,omitempty"` PeerASN string `json:"PeerASN,omitempty"` Nexthop string `json:"Nexthop,omitempty"` OriginASN string `json:"OriginASN,omitempty"` ASPath string `json:"ASPath,omitempty"` ASPathCount string `json:"ASPathCount,omitempty"` MED string `json:"MED,omitempty"` LocalPref string `json:"LocalPref,omitempty"` CommunityList string `json:"CommunityList,omitempty"` ExtComm string `json:"ExtComm,omitempty"` IsIPv4 string `json:"IsIPv4,omitempty"` IsNexthopIPv4 string `json:"IsNexthopIPv4,omitempty"` Labels string `json:"Labels,omitempty"` }
type EdgeObject ¶
type L3VPNNode ¶
type L3VPNNode struct { Key string `json:"_key,omitempty"` RD []string `json:"RD,omitempty"` RouterID string `json:"RouterID,omitempty"` ControlPlaneID string `json:"ControlPlaneID,omitempty"` ASN string `json:"ASN,omitempty"` Prefix_SID string `json:"Prefix_SID,omitempty"` ExtComm string `json:"ExtComm,omitempty"` }
type L3VPNPrefix ¶
type L3VPNPrefix struct { Key string `json:"_key,omitempty"` RD string `json:"RD,omitempty"` Prefix string `json:"Prefix,omitempty"` Length int `json:"Length,omitempty"` RouterID string `json:"RouterID,omitempty"` ControlPlaneID string `json:"ControlPlaneID,omitempty"` ASN string `json:"ASN,omitempty"` VPN_Label int `json:"VPN_Label,omitempty"` ExtComm string `json:"ExtComm,omitempty"` IPv4 string `json:"IPv4,omitempty"` }
func (L3VPNPrefix) GetKey ¶
func (p L3VPNPrefix) GetKey() (string, error)
func (L3VPNPrefix) GetType ¶
func (p L3VPNPrefix) GetType() string
func (*L3VPNPrefix) SetKey ¶
func (p *L3VPNPrefix) SetKey() error
type LSLink ¶
type LSLink struct { LocalRouterKey string `json:"_from,omitempty"` RemoteRouterKey string `json:"_to,omitempty"` Key string `json:"_key,omitempty"` LocalRouterID string `json:"LocalRouterID,omitempty"` RemoteRouterID string `json:"RemoteRouterID,omitempty"` Protocol string `json:"Protocol,omitempty"` IGPID string `json:"IGPID,omitempty"` Level string `json:"Level,omitempty"` RouterID string `json:"RouterID,omitempty"` NodeName string `json:"NodeName,omitempty"` ASN string `json:"ASN,omitempty"` LocalInterfaceIP string `json:"FromInterfaceIP,omitempty"` RemoteInterfaceIP string `json:"ToInterfaceIP,omitempty"` IGPMetric string `json:"IGPMetric,omitempty"` TEMetric string `json:"TEMetric,omitempty"` AdminGroup string `json:"AdminGroup,omitempty"` MaxLinkBW string `json:"MaxLinkBW,omitempty"` MaxResvBW string `json:"MaxResvBW,omitempty"` UnResvBW string `json:"UnResvBW,omitempty"` LinkProtection string `json:"LinkProtection,omitempty"` LinkName string `json:"LinkName,omitempty"` SRLG string `json:"SRLG"` UniDirMinDelay string `json:"UniDirMinDelay,omitempty"` AdjacencySID string `json:"AdjacencySID,omitempty"` }
type LSNode ¶
type LSNode struct { Key string `json:"_key,omitempty"` Name string `json:"Name,omitempty"` RouterID string `json:"RouterID,omitempty"` //BGPID string `json:"BGPID,omitempty"` ASN string `json:"ASN,omitempty"` SRGB string `json:"SRGB,omitempty"` SIDIndex string `json:"SIDIndex,omitempty"` PrefixSID string `json:"PrefixSID,omitempty"` IGPID string `json:"IGPID,omitempty"` }
type Router ¶
type Router struct { Key string `json:"_key,omitempty"` Name string `json:"Name,omitempty"` RouterIP string `json:"RouterIP,omitempty"` BGPID string `json:"BGPID,omitempty"` ASN string `json:"ASN,omitempty"` SRGB string `json:"SRGB,omitempty"` NodeSIDIndex string `json:"NodeSIDIndex,omitempty"` SRNodeSID string `json:"SRNodeSID,omitempty"` PeeringType string `json:"PeerType,omitempty"` }
Click to show internal directories.
Click to hide internal directories.