monitor

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Module(
	"monitor",
	fx.Decorate(func(log *zap.Logger) *zap.Logger {
		return log.Named("monitor")
	}),
	fx.Provide(NewMonitorModule),
)

Functions

This section is empty.

Types

type MonitorModule

type MonitorModule struct {
	Storage  storage.Storage
	Services []storage.Service
	Logger   *zap.Logger
	// contains filtered or unexported fields
}

func NewMonitorModule

func NewMonitorModule(params MonitorModuleParams) (*MonitorModule, error)

func (*MonitorModule) Monitor

func (m *MonitorModule) Monitor(ctx context.Context) (UpdatesChannel, error)

type MonitorModuleParams added in v1.1.0

type MonitorModuleParams struct {
	fx.In

	Storage storage.Storage
	Logger  *zap.Logger
}

type MonitorService

type MonitorService struct {
	Config ServiceMonitorConfig
	// contains filtered or unexported fields
}

func NewMonitorService

func NewMonitorService(config ServiceMonitorConfig) *MonitorService

func (*MonitorService) Monitor

func (s *MonitorService) Monitor(ctx context.Context) (ch ProbesChannel, err error)

type Probeer

type Probeer interface {
	Probe(context.Context) error
}

type ProbesChannel

type ProbesChannel chan error

type ServiceMonitorConfig

type ServiceMonitorConfig struct {
	HttpGet             probes.HttpGetConfig
	TcpSocket           probes.TcpSocketConfig
	InitialDelaySeconds uint16
	PeriodSeconds       uint16
	TimeoutSeconds      uint16
}

type ServiceState

type ServiceState string
const (
	ServiceOnline  ServiceState = "online"
	ServiceOffline ServiceState = "offline"
)

type ServiceStatus

type ServiceStatus struct {
	Id    string
	Name  string
	State ServiceState
	Error error
}

type UpdatesChannel

type UpdatesChannel chan ServiceStatus

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳