server

package
v1.8.4 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(o *options) error

Option customizes the configuration of the hubble-relay server.

func WithDebug added in v1.8.3

func WithDebug() Option

WithDebug enables debug mode.

func WithDialTimeout

func WithDialTimeout(t time.Duration) Option

WithDialTimeout sets the dial timeout that is used when establishing a connection to a hubble peer.

func WithErrorAggregationWindow

func WithErrorAggregationWindow(d time.Duration) Option

WithErrorAggregationWindow sets a time window during which errors with the same error message are coalesced. The aggregated error is forwarded to the downstream consumer either when the window expires or when a new, different error occurs (whichever happens first)

func WithHubbleTarget added in v1.8.3

func WithHubbleTarget(t string) Option

WithHubbleTarget sets the URL of the local hubble instance to connect to. This target MUST implement the Peer service.

func WithListenAddress

func WithListenAddress(a string) Option

WithListenAddress sets the listen address for the hubble-relay server.

func WithRetryTimeout

func WithRetryTimeout(t time.Duration) Option

WithRetryTimeout sets the duration to wait before attempting to re-connect to a hubble peer when the connection is lost.

func WithSortBufferDrainTimeout

func WithSortBufferDrainTimeout(d time.Duration) Option

WithSortBufferDrainTimeout sets the sort buffer drain timeout value. For flows requests where the total number of flows cannot be determined (typically for flows requests in follow mode), a flow is taken out of the buffer and sent to the client after duration d if the buffer is not full. This value must be greater than 0. Setting this value too low would render the flows sorting operation ineffective. A value between 500 milliseconds and 3 seconds should be constitute a good choice in most cases.

func WithSortBufferMaxLen

func WithSortBufferMaxLen(i int) Option

WithSortBufferMaxLen sets the maximum number of flows that can be buffered for sorting before being sent to the client. The provided value must be greater than 0 and is to be understood per client request. Therefore, it is advised to keep the value moderate (a value between 30 and 100 should constitute a good choice in most cases).

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is a proxy that connects to a running instance of hubble gRPC server via unix domain socket.

func New

func New(options ...Option) (*Server, error)

New creates a new Server.

func (*Server) Serve

func (s *Server) Serve() error

Serve starts the hubble-relay server. Serve does not return unless a listening fails with fatal errors. Serve will return a non-nil error if Stop() is not called.

func (*Server) Stop

func (s *Server) Stop()

Stop terminates the hubble-relay server.

Jump to

Keyboard shortcuts

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