gnmi

package
v0.10.12 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithClient added in v0.10.9

func WithClient(client *client) func(conn *conn)

WithClient sets the gnmi client for a new connection

func WithClientConn added in v0.10.9

func WithClientConn(clientConn *grpc.ClientConn) func(conn *conn)

WithClientConn sets client connection for a new connection

func WithTargetID added in v0.10.9

func WithTargetID(targetID topoapi.ID) func(conn *conn)

WithTargetID sets target ID for a new connection

Types

type Client

type Client interface {
	io.Closer
	Capabilities(ctx context.Context, r *gpb.CapabilityRequest) (*gpb.CapabilityResponse, error)
	CapabilitiesWithString(ctx context.Context, request string) (*gpb.CapabilityResponse, error)
	Get(ctx context.Context, r *gpb.GetRequest) (*gpb.GetResponse, error)
	GetWithString(ctx context.Context, request string) (*gpb.GetResponse, error)
	Set(ctx context.Context, r *gpb.SetRequest) (*gpb.SetResponse, error)
	SetWithString(ctx context.Context, request string) (*gpb.SetResponse, error)
	Subscribe(ctx context.Context, q baseClient.Query) error
}

Client gNMI client interface

type Conn

type Conn interface {
	Client
	ID() ConnID
	TargetID() topoapi.ID
	State() connectivity.State
	Connect()
	WatchState(ctx context.Context, ch chan<- connectivity.State) error
}

Conn gNMI connection interface

type ConnEvent added in v0.10.9

type ConnEvent struct {
	Conn      Conn
	EventType ConnEventType
}

ConnEvent connection event

type ConnEventType added in v0.10.9

type ConnEventType int

ConnEventType a connection event type

const (
	// None none connection event
	None ConnEventType = iota

	// Connected connected connection event
	Connected

	// Disconnected disconnected connection event
	Disconnected
)

func (ConnEventType) String added in v0.10.9

func (e ConnEventType) String() string

type ConnID

type ConnID string

ConnID connection ID

type ConnManager

type ConnManager interface {
	Get(ctx context.Context, targetID topoapi.ID) (Conn, error)
	List(ctx context.Context) ([]Conn, error)
	Watch(ctx context.Context, ch chan<- ConnEvent) error
	Connect(ctx context.Context, target *topoapi.Object) (Conn, error)
	Close(ctx context.Context, targetID topoapi.ID) error
}

ConnManager gNMI connection manager

func NewConnManager

func NewConnManager() ConnManager

NewConnManager creates a new gNMI connection manager

type Subscription

type Subscription struct {
	UpdatesOnly       bool
	Prefix            string
	Mode              string
	StreamMode        string
	SampleInterval    uint64
	HeartbeatInterval uint64
	Paths             [][]string
	Origin            string
}

Subscription subscription request information

func (*Subscription) Build

func (s *Subscription) Build() (*gnmipb.SubscribeRequest, error)

Build builds a gNMI subscription request

Jump to

Keyboard shortcuts

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