observer

package
v1.8.10 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOptions []observeroption.Option

DefaultOptions to include in the server. Other packages may extend this in their init() function.

Functions

This section is empty.

Types

type GRPCServer added in v1.8.0

type GRPCServer interface {
	observerpb.ObserverServer
	// Start starts the server and blocks.
	Start()
	// GetEventsChannel returns the channel to push monitor events to.
	GetEventsChannel() chan *flowpb.Payload
	// SetEventsChannel sets the events channel. For unit testing only.
	SetEventsChannel(chan *flowpb.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.FieldLogger
}

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.FieldLogger,
	options ...observeroption.Option,
) (*LocalObserverServer, error)

NewLocalServer returns a new local observer server.

func (*LocalObserverServer) GetEventsChannel

func (s *LocalObserverServer) GetEventsChannel() chan *flowpb.Payload

GetEventsChannel returns the event channel to receive flowpb.Payload events.

func (*LocalObserverServer) GetFlows

GetFlows implements the proto method for client requests.

func (*LocalObserverServer) GetLogger

func (s *LocalObserverServer) GetLogger() logrus.FieldLogger

GetLogger implements GRPCServer.GetLogger.

func (*LocalObserverServer) GetOptions

func (s *LocalObserverServer) GetOptions() observeroption.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

ServerStatus should have a comment, apparently. It returns the server status.

func (*LocalObserverServer) SetEventsChannel added in v1.8.0

func (s *LocalObserverServer) SetEventsChannel(events chan *flowpb.Payload)

SetEventsChannel implements GRPCServer.SetEventsChannel.

func (*LocalObserverServer) Start

func (s *LocalObserverServer) Start()

Start implements GRPCServer.Start.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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