device

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeviceConfig

func DeviceConfig(c []byte) *deviceConfig

DeviceConfig sets the startup config of the device to c. Today we do not allow the configuration to be changed in flight, but this can be implemented in the future.

func DisableRIBForwardReferences

func DisableRIBForwardReferences() *disableFwdRefs

DisableRIBForwardReferences instructs gribigo to disallow forward references within the RIB.

func GNMIAddr

func GNMIAddr(host string, i int) *gNMIAddr

GNMIAddr specifies the host and port that the gNMI server should listen on.

func GRIBIPort

func GRIBIPort(host string, i int) *gRIBIAddr

GRIBIPort is a device option that specifies that the port that should be listened on is i.

func TLSCredsFromFile

func TLSCredsFromFile(certFile, keyFile string) (*tlsCreds, error)

TLSCredsFromFile loads the credentials from the specified cert and key file and returns them such that they can be used for the gNMI and gRIBI servers.

Types

type DevOpt

type DevOpt interface {
	// contains filtered or unexported methods
}

DevOpt is an interface that is implemented by options that can be handed to New() for the device.

type Device

type Device struct {
	// contains filtered or unexported fields
}

Device is a wrapper struct that contains all functionalities for containing a gRIBI and gNMI target that has a fake system RIB.

func New

func New(ctx context.Context, opts ...DevOpt) (*Device, error)

New returns a new device with the specific context. It returns the device, and an optional error. The servers can be stopped by cancelling the supplied context.

func (*Device) GRIBIAddr

func (d *Device) GRIBIAddr() string

GRIBIAddr returns the address that the gRIBI server is listening on.

Jump to

Keyboard shortcuts

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