Documentation
¶
Index ¶
- Variables
- type NotificationChannelRepository
- type OriginRepository
- type RuleRepository
- type RuleService
- func (s *RuleService) Create(ctx context.Context, rule models.Rule) (models.Rule, error)
- func (s *RuleService) Delete(ctx context.Context, id string) error
- func (s *RuleService) Get(ctx context.Context, id string) (models.Rule, error)
- func (s *RuleService) GetAllRuleOptions(ctx context.Context) (*models.RuleOptions, error)
- func (s *RuleService) List(ctx context.Context) ([]models.Rule, error)
- func (s *RuleService) Update(ctx context.Context, id string, rule models.Rule) (models.Rule, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrChannelNotFound = fmt.Errorf("notification channel not found")
View Source
var ErrOriginsNotFound error = errors.New("one or more origins do not exist")
View Source
var ErrRecipientNotSupported = fmt.Errorf("recipient is not supported for the selected channel")
View Source
var ErrRecipientRequired = fmt.Errorf("recipient is required for the selected channel")
View Source
var ErrRuleLimitReached = fmt.Errorf("alert rule limit reached")
Functions ¶
This section is empty.
Types ¶
type NotificationChannelRepository ¶
type NotificationChannelRepository interface {
GetNotificationChannelById(ctx context.Context, id string) (models.NotificationChannel, error)
ListNotificationChannelsByType(ctx context.Context, channelType models.ChannelType) ([]models.NotificationChannel, error)
}
type OriginRepository ¶
type RuleRepository ¶
type RuleRepository interface {
Get(ctx context.Context, id string) (models.Rule, error)
List(ctx context.Context) ([]models.Rule, error)
Create(ctx context.Context, rule models.Rule) (models.Rule, error)
Update(ctx context.Context, id string, rule models.Rule) (models.Rule, error)
Delete(ctx context.Context, id string) error
}
type RuleService ¶
type RuleService struct {
// contains filtered or unexported fields
}
func NewRuleService ¶
func NewRuleService(store RuleRepository, channelStore NotificationChannelRepository, originStore OriginRepository, ruleLimit int) *RuleService
func (*RuleService) Get ¶
Get retrieves a rule by its ID. If the rule is invalid due to missing references, it is deactivated, but still returned.
func (*RuleService) GetAllRuleOptions ¶
func (s *RuleService) GetAllRuleOptions(ctx context.Context) (*models.RuleOptions, error)
Click to show internal directories.
Click to hide internal directories.