Documentation
¶
Index ¶
- type Client
- type Config
- type Server
- func (srv *Server) Address() string
- func (srv *Server) Capabilities(context.Context, *gnmipb.CapabilityRequest) (*gnmipb.CapabilityResponse, error)
- func (s *Server) Get(ctx context.Context, req *gnmipb.GetRequest) (*gnmipb.GetResponse, error)
- func (srv *Server) Port() int64
- func (srv *Server) Serve() error
- func (srv *Server) Set(context.Context, *gnmipb.SetRequest) (*gnmipb.SetResponse, error)
- func (srv *Server) Subscribe(stream gnmipb.GNMI_SubscribeServer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client contains information about a subscribe client that has connected to the server.
func (*Client) Close ¶
func (c *Client) Close()
Closing of client queue is triggered upon end of stream receive or stream error or fatal error of any client go routine . it will cause cancle of client context and exit of the send goroutines.
func (*Client) Run ¶
func (c *Client) Run(stream gnmipb.GNMI_SubscribeServer) (err error)
Run starts the subscribe client. The first message received must be a SubscriptionList. Once the client is started, it will run until the stream is closed or the schedule completes. For Poll queries the Run will block internally after sync until a Poll request is made to the server.
type Config ¶
type Config struct { // Port for the Server to listen on. If 0 or unset the Server will pick a port // for this Server. Port int64 }
Config is a collection of values for Server
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server manages a single gNMI Server implementation. Each client that connects via Subscribe or Get will receive a stream of updates based on the requested path. Set request is processed by server too.
func NewServer ¶
func NewServer(config *Config, opts []grpc.ServerOption) (*Server, error)
New returns an initialized Server.
func (*Server) Capabilities ¶
func (srv *Server) Capabilities(context.Context, *gnmipb.CapabilityRequest) (*gnmipb.CapabilityResponse, error)
Capabilities method is not implemented. Refer to gnxi for examples with openconfig integration
func (*Server) Get ¶
func (s *Server) Get(ctx context.Context, req *gnmipb.GetRequest) (*gnmipb.GetResponse, error)
Get implements the Get RPC in gNMI spec.
func (*Server) Set ¶
func (srv *Server) Set(context.Context, *gnmipb.SetRequest) (*gnmipb.SetResponse, error)
Set method is not implemented. Refer to gnxi for examples with openconfig integration