mock

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AristaBGPUpdate

func AristaBGPUpdate() *gnmi.Notification

AristaBGPUpdate return gNMI notification included an Arista BGP update

func AristaUpdate

func AristaUpdate() *gnmi.Notification

AristaUpdate returns gNMI notification included an Arista interface update

func CiscoXRInterface

func CiscoXRInterface() *gnmi.Notification

CiscoXRInterface return a gNMI notification included a Cisco XR interface update

func JuniperBGPSample

func JuniperBGPSample() *jpb.OpenConfigData

JuniperBGPSample returns JTI mock data included BGP metrics

func JuniperFakeDuplicateLabel

func JuniperFakeDuplicateLabel() *gnmi.Notification

JuniperFakeDuplicateLabel returns gNMI update included a Juniper fake update

func JuniperFakeKeyLabel

func JuniperFakeKeyLabel() *gnmi.Notification

JuniperFakeKeyLabel returns gNMI update included a Juniper fake update

func JuniperJTILo0InterfaceSample

func JuniperJTILo0InterfaceSample() *jpb.OpenConfigData

JuniperJTILo0InterfaceSample returns JTI mock data included an interface metrics

func JuniperJTIMix

func JuniperJTIMix() *jpb.OpenConfigData

JuniperJTIMix returns JTI mock data included fake metrics

func JuniperUpdate

func JuniperUpdate() *gnmi.Notification

JuniperUpdate returns a gNMI notification included a Juniper interface update

func MDTInterface

func MDTInterface() *telemetry.Telemetry

MDTInterface returns Cisco MDT mock data included two recursive sets

func MDTInterfaceII

func MDTInterfaceII() *telemetry.Telemetry

MDTInterfaceII returns Cisco MDT mock data included two recursive sets (interface counters)

func StartGNMIServer

func StartGNMIServer(addr string, resp Response) (net.Listener, error)

StartGNMIServer starts gNMI mock server

func StartJTIServer

func StartJTIServer(addr string, resp JTIResponse) (net.Listener, error)

StartJTIServer starts JTI mock server

Types

type GNMIServer

type GNMIServer struct {
	Resp Response
}

GNMIServer represents gNMI server

func (*GNMIServer) Capabilities

Capabilities is a capabilities mock method

func (*GNMIServer) Get

Get is a get mock method

func (*GNMIServer) Set

Set is a set mock method

func (*GNMIServer) Subscribe

func (g *GNMIServer) Subscribe(server gnmi.GNMI_SubscribeServer) error

Subscribe is a mock subscribe method which it returns the notifications to the targets. it doesn't go through subscription procedures instead it returns the configured responses.

type JTIResponse

JTIResponse represents mock JTI response

type OpenConfigTelemetryServer

type OpenConfigTelemetryServer struct {
	Resp JTIResponse
}

OpenConfigTelemetryServer represents OpenConfigTelemetry mock Server

func (*OpenConfigTelemetryServer) CancelTelemetrySubscription

CancelTelemetrySubscription is mock CancelTelemetrySubscription method

func (*OpenConfigTelemetryServer) GetDataEncodings

GetDataEncodings is mock GetDataEncodings method

func (*OpenConfigTelemetryServer) GetTelemetryOperationalState

GetTelemetryOperationalState is mock GetTelemetryOperationalState method

func (*OpenConfigTelemetryServer) GetTelemetrySubscriptions

GetTelemetrySubscriptions is mock GetTelemetrySubscriptions method

func (*OpenConfigTelemetryServer) TelemetrySubscribe

TelemetrySubscribe is mock TelemetrySubscribe method

type Response

type Response interface {
	Run(gnmi.GNMI_SubscribeServer) error
}

Response represents gNMI response

type Update

type Update struct {
	Notification *gnmi.Notification
	Attempt      int
}

Update represents gNMI update

func (Update) Run

func (u Update) Run(server gnmi.GNMI_SubscribeServer) error

Run is gNMI server loop to return mock responses to the targets.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL