server

package
v0.0.0-...-d251121 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IProcessor

type IProcessor interface {
	Start() error
	Stop(context.Context) error
}

IProcessor defines the interface that need to be implemented by each monitor

type Instance

type Instance struct {
	Settings Settings

	Logger logrus.Logger
	// contains filtered or unexported fields
}

Instance defines the exporter instance

func NewInstance

func NewInstance(settings Settings) *Instance

NewInstance creates a new exporter instance

func (*Instance) AddProcessor

func (inst *Instance) AddProcessor(processor IProcessor)

AddProcessor allows to add monitors to the exporter instance

func (*Instance) Shutdown

func (inst *Instance) Shutdown(ctx context.Context)

Shutdown gracefully shutdown of the http server for each monitor

func (*Instance) Start

func (inst *Instance) Start()

Start brings up the http server for each monitor

type Monitor

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

Monitor defines the http metrics server

func NewMonitor

func NewMonitor(settings MonitorSettings, logger *logrus.Logger, mcollectors []collector.ICollector) (*Monitor, error)

NewMonitor creates a new Monitor instance providing http metrics server

func (*Monitor) Start

func (m *Monitor) Start() error

Start starts the http metrics server of the Monitor

func (*Monitor) Stop

func (m *Monitor) Stop(ctx context.Context) error

Stop stops the http metrics server of the Monitor

type MonitorSettings

type MonitorSettings struct {
	Address              string
	MaxConnections       int64
	KeepAlived           bool
	ReUsePort            bool
	TCPKeepAliveInterval time.Duration
}

MonitorSettings defines required attributes

type Settings

type Settings struct {
	Monitor MonitorSettings
	Trivy   collector.Settings
}

Settings defines the global server settings

Jump to

Keyboard shortcuts

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