monitor

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidationError

func IsValidationError(err error) bool

func SanitizeSSLThresholds

func SanitizeSSLThresholds(thresholds []int) []int

func ValidateAdvancedOptions

func ValidateAdvancedOptions(monitorType models.MonitorType, target string, advanced models.MonitorAdvancedOptions) error

Types

type MonitorUpsertInput

type MonitorUpsertInput struct {
	Name            string
	Type            models.MonitorType
	Target          string
	Monitoring      models.MonitorConfig
	SSLThresholds   []int
	IntervalSeconds int
	TimeoutSeconds  int
	ComponentID     string
	SubComponentID  string
}

type Service

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

func NewService

func NewService(repo repository.MonitorRepository) *Service

func (*Service) Create

func (s *Service) Create(ctx context.Context, input MonitorUpsertInput) (models.Monitor, error)

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, id primitive.ObjectID) error

func (*Service) GetMonitorLogsPaginated

func (s *Service) GetMonitorLogsPaginated(ctx context.Context, monitorID primitive.ObjectID, page, limit int) (models.PaginatedResult[models.MonitorLog], error)

func (*Service) History

func (s *Service) History(ctx context.Context, monitorID primitive.ObjectID, limit int64) ([]models.EnhancedMonitorLog, error)

func (*Service) List

func (s *Service) List(ctx context.Context, page, limit int) ([]models.Monitor, int64, error)

func (*Service) Logs

func (s *Service) Logs(ctx context.Context, monitorID primitive.ObjectID, limit int64) ([]models.MonitorLog, error)

func (*Service) Outages

func (s *Service) Outages(ctx context.Context) ([]models.Outage, error)

func (*Service) Update

func (s *Service) Update(ctx context.Context, id primitive.ObjectID, input MonitorUpsertInput) (bool, error)

func (*Service) Uptime

func (s *Service) Uptime(ctx context.Context, monitorID primitive.ObjectID, since time.Time) ([]models.DailyUptime, error)

type ValidationError

type ValidationError struct {
	Message string
}

func (*ValidationError) Error

func (e *ValidationError) Error() string

Jump to

Keyboard shortcuts

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