server

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyStarted = errors.New("server already started")
)

Functions

This section is empty.

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithAuthBearer

func WithAuthBearer(token string) Option

WithAuthBearer configures the server to validate connections based on the provided token

func WithDiskStorage

func WithDiskStorage(path string) Option

WithDiskStorage enables the persistence of the internal state of the server to disk. Path contains the root folder where the data will be stored

func WithLogger

func WithLogger(l logging.Logger) Option

WithLogger changes the internal logger. In case of not setting it, the server does not output logs

func WithReconciliationPeriod

func WithReconciliationPeriod(p time.Duration) Option

WithReconciliationPeriod sets how often the server will try to reconcile its configuration with the connected samplers.

func WithTLS

func WithTLS(certFile, keyFile string) Option

WithTLS enables TLS communication encryption

type Server

type Server struct {
	protos.UnimplementedControlPlaneServer
	// contains filtered or unexported fields
}

func New

func New(uid string, serverOptions ...Option) (*Server, error)

func (*Server) Addr

func (s *Server) Addr() net.Addr

func (*Server) ClientConn

func (s *Server) ClientConn(stream protos.ControlPlane_ClientConnServer) error

func (*Server) Events added in v0.1.0

func (s *Server) Events() chan event.Event

func (*Server) GetSamplers added in v0.3.0

func (s *Server) GetSamplers(resourceName, samplerName string) ([]*control.Sampler, error)

func (*Server) SamplerConn

func (s *Server) SamplerConn(stream protos.ControlPlane_SamplerConnServer) error

func (*Server) Start

func (s *Server) Start(listenAddr string) error

func (*Server) Stop

func (s *Server) Stop(_ time.Duration) error

Jump to

Keyboard shortcuts

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