command

package
v0.26.7 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BulkCheckEndpoints

type BulkCheckEndpoints struct {
}

type BulkCheckEndpointsHandler

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

func NewBulkCheckEndpointsHandler

func NewBulkCheckEndpointsHandler(
	httpChecker httpChecker,
	txProvider TransactionProvider,
	eventPublisher EventPublisher,
	monitorRepository monitor.Repository,
) BulkCheckEndpointsHandler

func (BulkCheckEndpointsHandler) Execute

type CheckEndpoint

type CheckEndpoint struct {
	MonitorID domain.ID
}

type CheckEndpointHandler

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

func NewCheckEndpointHandler

func NewCheckEndpointHandler(
	httpChecker httpChecker,
	monitorRepository monitor.Repository,
	eventPublisher EventPublisher,
) CheckEndpointHandler

func (CheckEndpointHandler) Execute

type CheckResult

type CheckResult struct {
	Result          *monitor.CheckResult
	ResponseHeaders string
	RequestHeaders  string
	ResponseStatus  int16
	ResponseBody    string
}

type CreateAccount

type CreateAccount struct {
	Account *account.Account
}

type CreateAccountHandler

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

func NewCreateAccountHandler

func NewCreateAccountHandler(txProvider TransactionProvider) CreateAccountHandler

func (CreateAccountHandler) Execute

type CreateIncident

type CreateIncident struct {
	MonitorID     domain.ID
	CheckResultID domain.ID
	CheckedUrl    string
}

type CreateIncidentHandler

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

func NewCreateIncidentHandler

func NewCreateIncidentHandler(txProvider TransactionProvider, checkResultFinder checkResultFinder) CreateIncidentHandler

func (CreateIncidentHandler) Execute

TODO: Test this command's logic ;)

type CreateMonitor

type CreateMonitor struct {
	Monitor *monitor.Monitor
}

type CreateMonitorHandler

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

func NewCreateMonitorHandler

func NewCreateMonitorHandler(monitorRepository monitor.Repository, eventPublisher EventPublisher) CreateMonitorHandler

func (CreateMonitorHandler) Execute

type DeleteMonitor

type DeleteMonitor struct {
	ID domain.ID
}

type DeleteMonitorHandler

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

func NewDeleteMonitorHandler

func NewDeleteMonitorHandler(txProvider TransactionProvider) DeleteMonitorHandler

func (DeleteMonitorHandler) Execute

type EditMonitor

type EditMonitor struct {
	ID                     domain.ID
	EndpointUrl            string
	CheckIntervalInSeconds time.Duration
}

type EditMonitorHandler

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

func NewEditMonitorHandler

func NewEditMonitorHandler(monitorRepository monitor.Repository) EditMonitorHandler

func (EditMonitorHandler) Execute

func (h EditMonitorHandler) Execute(ctx context.Context, cmd EditMonitor) error

type EndpointCheckFailedEvent

type EndpointCheckFailedEvent struct {
	MonitorID     string
	CheckedURL    string
	CheckResultID string
	At            time.Time
}

type EndpointCheckSucceededEvent

type EndpointCheckSucceededEvent struct {
	MonitorID string
	At        time.Time
}

type EventPublisher

type EventPublisher interface {
	PublishMonitorCreated(ctx context.Context, event MonitorCreatedEvent) error
	PublishIncidentCreated(ctx context.Context, event IncidentCreatedEvent) error
	PublishIncidentResolved(ctx context.Context, event IncidentResolvedEvent) error
	PublishEndpointCheckFailed(ctx context.Context, event EndpointCheckFailedEvent) error
	PublishEndpointCheckSucceeded(ctx context.Context, event EndpointCheckSucceededEvent) error
}

type IncidentCreatedEvent

type IncidentCreatedEvent struct {
	MonitorID  string
	IncidentID string
	At         time.Time
}

type IncidentResolvedEvent

type IncidentResolvedEvent struct {
	MonitorID  string
	IncidentID string
	At         time.Time
}

type LogIn

type LogIn struct {
	Email             account.Email
	PlainTextPassword string
}

type LoginHandler

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

func NewLoginHandler

func NewLoginHandler(userRepository account.UserRepository, tokenSigner tokenSigner) LoginHandler

func (LoginHandler) Execute

func (h LoginHandler) Execute(ctx context.Context, cmd LogIn) (string, error)

type MonitorCreatedEvent

type MonitorCreatedEvent struct {
	ID        string
	CreatedAt time.Time
}

type NotifyMonitorSubscribersOnIncident

type NotifyMonitorSubscribersOnIncident struct {
	IncidentID domain.ID
	MonitorID  domain.ID
}

type NotifyMonitorSubscribersOnIncidentHandler

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

func NewNotifyMonitorSubscribersOnIncidentHandler

func NewNotifyMonitorSubscribersOnIncidentHandler(
	txProvider TransactionProvider,
	subscriberNotifier subscriberNotifier,
) NotifyMonitorSubscribersOnIncidentHandler

func (NotifyMonitorSubscribersOnIncidentHandler) Execute

type NotifyOnIncidentResolved

type NotifyOnIncidentResolved struct {
	IncidentID domain.ID
	MonitorID  domain.ID
}

type NotifyOnIncidentResolvedHandler

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

func NewNotifyOnIncidentResolvedHandler

func NewNotifyOnIncidentResolvedHandler(
	monitorRepository monitor.Repository,
	userRepository account.UserRepository,
	subscriberNotifier incidentResolvedNotifier,
) NotifyOnIncidentResolvedHandler

func (NotifyOnIncidentResolvedHandler) Execute

type ResolveIncident

type ResolveIncident struct {
	MonitorID domain.ID
}

type ResolveIncidentHandler

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

func NewResolveIncidentHandler

func NewResolveIncidentHandler(txProvider TransactionProvider) ResolveIncidentHandler

func (ResolveIncidentHandler) Execute

type ToggleMonitorPause

type ToggleMonitorPause struct {
	MonitorID domain.ID
	Pause     bool
}

type ToggleMonitorPauseHandler

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

func NewToggleMonitorPauseHandler

func NewToggleMonitorPauseHandler(txProvider TransactionProvider) ToggleMonitorPauseHandler

func (ToggleMonitorPauseHandler) Execute

type TransactFunc

type TransactFunc func(adapters TransactableAdapters) error

type TransactableAdapters

type TransactableAdapters struct {
	// IAM
	AccountRepository account.Repository
	UserRepository    account.UserRepository

	// Monitor
	MonitorRepository  monitor.Repository
	IncidentRepository monitor.IncidentRepository

	// Event publisher
	EventPublisher EventPublisher
}

type TransactionProvider

type TransactionProvider interface {
	Transact(ctx context.Context, f TransactFunc) error
}

Jump to

Keyboard shortcuts

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