Documentation
¶
Index ¶
- Variables
- type GRPCServer
- type LocalObserverServer
- func (s *LocalObserverServer) GetEventsChannel() chan *pb.Payload
- func (s *LocalObserverServer) GetFlows(req *observer.GetFlowsRequest, server observer.Observer_GetFlowsServer) (err error)
- func (s *LocalObserverServer) GetLogger() *logrus.Entry
- func (s *LocalObserverServer) GetOptions() serveroption.Options
- func (s *LocalObserverServer) GetPayloadParser() *parser.Parser
- func (s *LocalObserverServer) GetRingBuffer() *container.Ring
- func (s *LocalObserverServer) GetStopped() chan struct{}
- func (s *LocalObserverServer) ServerStatus(ctx context.Context, req *observer.ServerStatusRequest) (*observer.ServerStatusResponse, error)
- func (s *LocalObserverServer) SetEventsChannel(events chan *pb.Payload)
- func (s *LocalObserverServer) Start()
- type ObserverServer
Constants ¶
This section is empty.
Variables ¶
var DefaultOptions []serveroption.Option
DefaultOptions to include in the server. Other packages may extend this in their init() function.
Functions ¶
This section is empty.
Types ¶
type GRPCServer ¶
type GRPCServer interface {
observer.ObserverServer
// Start starts the server and blocks.
Start()
// GetEventsChannel returns the channel to push monitor events to.
GetEventsChannel() chan *pb.Payload
// SetEventsChannel sets the events channel. For unit testing only.
SetEventsChannel(chan *pb.Payload)
///GetRingBuffer returns the underlying ring buffer to parsed events.
GetRingBuffer() *container.Ring
// GetStopped returns a channel that gets closed at the end of the
// main server loop after all the events have been processes. Used
// in unit testing.
GetStopped() chan struct{}
// GetLogger returns the logger assigned to this gRPC server.
GetLogger() *logrus.Entry
}
GRPCServer defines the interface for Hubble gRPC server, extending the auto-generated ObserverServer interface from the protobuf definition.
type LocalObserverServer ¶
type LocalObserverServer struct {
// contains filtered or unexported fields
}
LocalObserverServer is an implementation of the server.Observer interface that's meant to be run embedded inside the Cilium process. It ignores all the state change events since the state is available locally.
func NewLocalServer ¶
func NewLocalServer( payloadParser *parser.Parser, logger *logrus.Entry, options ...serveroption.Option, ) (*LocalObserverServer, error)
NewLocalServer returns a new local observer server.
func (*LocalObserverServer) GetEventsChannel ¶
func (s *LocalObserverServer) GetEventsChannel() chan *pb.Payload
GetEventsChannel returns the event channel to receive pb.Payload events.
func (*LocalObserverServer) GetFlows ¶
func (s *LocalObserverServer) GetFlows( req *observer.GetFlowsRequest, server observer.Observer_GetFlowsServer, ) (err error)
GetFlows implements the proto method for client requests.
func (*LocalObserverServer) GetLogger ¶
func (s *LocalObserverServer) GetLogger() *logrus.Entry
GetLogger implements GRPCServer.GetLogger.
func (*LocalObserverServer) GetOptions ¶
func (s *LocalObserverServer) GetOptions() serveroption.Options
GetOptions implements serveroptions.Server.GetOptions.
func (*LocalObserverServer) GetPayloadParser ¶
func (s *LocalObserverServer) GetPayloadParser() *parser.Parser
GetPayloadParser implements GRPCServer.GetPayloadParser.
func (*LocalObserverServer) GetRingBuffer ¶
func (s *LocalObserverServer) GetRingBuffer() *container.Ring
GetRingBuffer implements GRPCServer.GetRingBuffer.
func (*LocalObserverServer) GetStopped ¶
func (s *LocalObserverServer) GetStopped() chan struct{}
GetStopped implements GRPCServer.GetStopped.
func (*LocalObserverServer) ServerStatus ¶
func (s *LocalObserverServer) ServerStatus( ctx context.Context, req *observer.ServerStatusRequest, ) (*observer.ServerStatusResponse, error)
ServerStatus should have a comment, apparently. It returns the server status.
func (*LocalObserverServer) SetEventsChannel ¶
func (s *LocalObserverServer) SetEventsChannel(events chan *pb.Payload)
SetEventsChannel implements GRPCServer.SetEventsChannel.
func (*LocalObserverServer) Start ¶
func (s *LocalObserverServer) Start()
Start implements GRPCServer.Start.
type ObserverServer ¶
type ObserverServer struct {
// contains filtered or unexported fields
}
ObserverServer is a server that can store events in memory
func NewServer ¶
func NewServer( ciliumClient client.Client, endpoints v1.EndpointsHandler, ipCache *ipcache.IPCache, fqdnCache cilium.FqdnCache, serviceCache *servicecache.ServiceCache, payloadParser *parser.Parser, maxFlows int, eventQueueSize int, logger *logrus.Entry, ) (*ObserverServer, error)
NewServer returns a server that can store up to the given of maxFlows received.
func (*ObserverServer) GetGRPCServer ¶
func (s *ObserverServer) GetGRPCServer() GRPCServer
GetGRPCServer returns the GRPCServer embedded in this ObserverServer.
func (*ObserverServer) HandleMonitorSocket ¶
func (s *ObserverServer) HandleMonitorSocket(ctx context.Context, nodeName string) error
HandleMonitorSocket connects to the monitor socket and consumes monitor events.
func (*ObserverServer) Start ¶
func (s *ObserverServer) Start()
Start starts the server to handle the events sent to the events channel as well as handle events to the EpAdd and EpDel channels.