Documentation ¶
Index ¶
- func SetLogLevel(lvl logrus.Level)
- func SetLogOutput(out io.Writer)
- func SetLogger(l *logrus.Logger)
- type BinapiClient
- func (b *BinapiClient) CheckCompatiblity(msgs ...api.Message) error
- func (b *BinapiClient) Close()
- func (b *BinapiClient) Invoke(_ context.Context, request api.Message, reply api.Message) error
- func (b *BinapiClient) NewStream(_ context.Context, _ ...api.StreamOption) (api.Stream, error)
- func (b *BinapiClient) SendMultiRequest(msg api.Message) api.MultiRequestCtx
- func (b *BinapiClient) SendRequest(msg api.Message) api.RequestCtx
- func (b *BinapiClient) SetReplyTimeout(timeout time.Duration)
- func (b *BinapiClient) SubscribeNotification(notifChan chan api.Message, event api.Message) (api.SubscriptionCtx, error)
- type BinapiCompatibilityRequest
- type BinapiCompatibilityResponse
- type BinapiRPC
- func (s *BinapiRPC) CloseStream(req RPCStreamReqResp, resp *RPCStreamReqResp) error
- func (s *BinapiRPC) Compatibility(req BinapiCompatibilityRequest, resp *BinapiCompatibilityResponse) error
- func (s *BinapiRPC) Invoke(req BinapiRequest, resp *BinapiResponse) error
- func (s *BinapiRPC) NewAPIStream(req RPCStreamReqResp, resp *RPCStreamReqResp) error
- func (s *BinapiRPC) ReceiveMessage(req RPCStreamReqResp, resp *RPCStreamReqResp) error
- func (s *BinapiRPC) SendMessage(req RPCStreamReqResp, resp *RPCStreamReqResp) error
- type BinapiRequest
- type BinapiResponse
- type Client
- type RPCStream
- type RPCStreamReqResp
- type Server
- func (p *Server) ConnectBinapi(binapi adapter.VppAPI) error
- func (p *Server) ConnectStats(stats adapter.StatsAPI) error
- func (p *Server) DisconnectBinapi()
- func (p *Server) DisconnectStats()
- func (p *Server) ListenAndServe(addr string) error
- func (p *Server) ServeCodec(codec rpc.ServerCodec)
- func (p *Server) ServeConn(conn io.ReadWriteCloser)
- func (p *Server) ServeHTTP(w http.ResponseWriter, req *http.Request)
- type StatsClient
- func (s *StatsClient) GetBufferStats(bufStats *api.BufferStats) error
- func (s *StatsClient) GetErrorStats(errStats *api.ErrorStats) error
- func (s *StatsClient) GetInterfaceStats(ifaceStats *api.InterfaceStats) error
- func (s *StatsClient) GetMemoryStats(memStats *api.MemoryStats) error
- func (s *StatsClient) GetNodeStats(nodeStats *api.NodeStats) error
- func (s *StatsClient) GetSystemStats(sysStats *api.SystemStats) error
- type StatsRPC
- type StatsRequest
- type StatsResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BinapiClient ¶
type BinapiClient struct {
// contains filtered or unexported fields
}
func (*BinapiClient) CheckCompatiblity ¶
func (b *BinapiClient) CheckCompatiblity(msgs ...api.Message) error
func (*BinapiClient) Close ¶
func (b *BinapiClient) Close()
func (*BinapiClient) NewStream ¶
func (b *BinapiClient) NewStream(_ context.Context, _ ...api.StreamOption) (api.Stream, error)
func (*BinapiClient) SendMultiRequest ¶
func (b *BinapiClient) SendMultiRequest(msg api.Message) api.MultiRequestCtx
func (*BinapiClient) SendRequest ¶
func (b *BinapiClient) SendRequest(msg api.Message) api.RequestCtx
func (*BinapiClient) SetReplyTimeout ¶
func (b *BinapiClient) SetReplyTimeout(timeout time.Duration)
func (*BinapiClient) SubscribeNotification ¶
func (b *BinapiClient) SubscribeNotification(notifChan chan api.Message, event api.Message) (api.SubscriptionCtx, error)
type BinapiCompatibilityRequest ¶
type BinapiCompatibilityRequest struct {
MsgNameCrcs []string
}
type BinapiRPC ¶
type BinapiRPC struct {
// contains filtered or unexported fields
}
BinapiRPC is a RPC server for proxying client request to api.Channel or api.Stream.
func NewBinapiRPC ¶
NewBinapiRPC returns new BinapiRPC to be used as RPC server proxying request to given api.Channel.
func (*BinapiRPC) CloseStream ¶
func (s *BinapiRPC) CloseStream(req RPCStreamReqResp, resp *RPCStreamReqResp) error
func (*BinapiRPC) Compatibility ¶
func (s *BinapiRPC) Compatibility(req BinapiCompatibilityRequest, resp *BinapiCompatibilityResponse) error
func (*BinapiRPC) Invoke ¶
func (s *BinapiRPC) Invoke(req BinapiRequest, resp *BinapiResponse) error
func (*BinapiRPC) NewAPIStream ¶
func (s *BinapiRPC) NewAPIStream(req RPCStreamReqResp, resp *RPCStreamReqResp) error
func (*BinapiRPC) ReceiveMessage ¶
func (s *BinapiRPC) ReceiveMessage(req RPCStreamReqResp, resp *RPCStreamReqResp) error
func (*BinapiRPC) SendMessage ¶
func (s *BinapiRPC) SendMessage(req RPCStreamReqResp, resp *RPCStreamReqResp) error
type BinapiRequest ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func Connect ¶
Connect dials remote proxy server on given address and returns new client if successful.
func (*Client) NewBinapiClient ¶
func (c *Client) NewBinapiClient() (*BinapiClient, error)
NewBinapiClient returns new BinapiClient which implements api.Channel.
func (*Client) NewStatsClient ¶
func (c *Client) NewStatsClient() (*StatsClient, error)
NewStatsClient returns new StatsClient which implements api.StatsProvider.
type RPCStream ¶
type RPCStream struct {
// contains filtered or unexported fields
}
RPCStream is a stream for forwarding requests to BinapiRPC's stream.
type RPCStreamReqResp ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server defines a proxy server that serves client requests to stats and binapi.
func (*Server) DisconnectBinapi ¶
func (p *Server) DisconnectBinapi()
func (*Server) DisconnectStats ¶
func (p *Server) DisconnectStats()
func (*Server) ListenAndServe ¶
func (*Server) ServeCodec ¶
func (p *Server) ServeCodec(codec rpc.ServerCodec)
func (*Server) ServeConn ¶
func (p *Server) ServeConn(conn io.ReadWriteCloser)
type StatsClient ¶
type StatsClient struct {
// contains filtered or unexported fields
}
func (*StatsClient) GetBufferStats ¶
func (s *StatsClient) GetBufferStats(bufStats *api.BufferStats) error
func (*StatsClient) GetErrorStats ¶
func (s *StatsClient) GetErrorStats(errStats *api.ErrorStats) error
func (*StatsClient) GetInterfaceStats ¶
func (s *StatsClient) GetInterfaceStats(ifaceStats *api.InterfaceStats) error
func (*StatsClient) GetMemoryStats ¶
func (s *StatsClient) GetMemoryStats(memStats *api.MemoryStats) error
func (*StatsClient) GetNodeStats ¶
func (s *StatsClient) GetNodeStats(nodeStats *api.NodeStats) error
func (*StatsClient) GetSystemStats ¶
func (s *StatsClient) GetSystemStats(sysStats *api.SystemStats) error
type StatsRPC ¶
type StatsRPC struct {
// contains filtered or unexported fields
}
StatsRPC is a RPC server for proxying client request to api.StatsProvider.
func NewStatsRPC ¶
NewStatsRPC returns new StatsRPC to be used as RPC server proxying request to given api.StatsProvider.
func (*StatsRPC) GetStats ¶
func (s *StatsRPC) GetStats(req StatsRequest, resp *StatsResponse) error
type StatsRequest ¶
type StatsRequest struct {
StatsType string
}
type StatsResponse ¶
type StatsResponse struct { SysStats *api.SystemStats NodeStats *api.NodeStats IfaceStats *api.InterfaceStats ErrStats *api.ErrorStats BufStats *api.BufferStats MemStats *api.MemoryStats }