Documentation ¶
Index ¶
- Variables
- func InternalNotificationRuleStoreError(err error) *errors.Error
- func UnavailableNotificationRuleStoreError(err error) *errors.Error
- type RuleService
- func (s *RuleService) CreateNotificationRule(ctx context.Context, nr influxdb.NotificationRuleCreate, userID platform.ID) error
- func (s *RuleService) DeleteNotificationRule(ctx context.Context, id platform.ID) error
- func (s *RuleService) FindNotificationRuleByID(ctx context.Context, id platform.ID) (influxdb.NotificationRule, error)
- func (s *RuleService) FindNotificationRules(ctx context.Context, filter influxdb.NotificationRuleFilter, ...) (nrs []influxdb.NotificationRule, n int, err error)
- func (s *RuleService) PatchNotificationRule(ctx context.Context, id platform.ID, upd influxdb.NotificationRuleUpdate) (influxdb.NotificationRule, error)
- func (s *RuleService) PutNotificationRule(ctx context.Context, nr influxdb.NotificationRuleCreate) error
- func (s *RuleService) UpdateNotificationRule(ctx context.Context, id platform.ID, nr influxdb.NotificationRuleCreate, ...) (influxdb.NotificationRule, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotificationRuleNotFound is used when the notification rule is not found. ErrNotificationRuleNotFound = &errors.Error{ Msg: "notification rule not found", Code: errors.ENotFound, } // ErrInvalidNotificationRuleID is used when the service was provided // an invalid ID format. ErrInvalidNotificationRuleID = &errors.Error{ Code: errors.EInvalid, Msg: "provided notification rule ID has invalid format", } )
Functions ¶
func InternalNotificationRuleStoreError ¶
InternalNotificationRuleStoreError is used when the error comes from an internal system.
func UnavailableNotificationRuleStoreError ¶
UnavailableNotificationRuleStoreError is used if we aren't able to interact with the store, it means the store is not available at the moment (e.g. network).
Types ¶
type RuleService ¶
type RuleService struct {
// contains filtered or unexported fields
}
RuleService is an implementation of the influxdb CheckService It is backed by the kv store abstraction.
func New ¶
func New(logger *zap.Logger, store kv.Store, tasks taskmodel.TaskService, orgs influxdb.OrganizationService, endpoints influxdb.NotificationEndpointService) (*RuleService, error)
New constructs and configures a notification rule service
func (*RuleService) CreateNotificationRule ¶
func (s *RuleService) CreateNotificationRule(ctx context.Context, nr influxdb.NotificationRuleCreate, userID platform.ID) error
CreateNotificationRule creates a new notification rule and sets b.ID with the new identifier.
func (*RuleService) DeleteNotificationRule ¶
DeleteNotificationRule removes a notification rule by ID.
func (*RuleService) FindNotificationRuleByID ¶
func (s *RuleService) FindNotificationRuleByID(ctx context.Context, id platform.ID) (influxdb.NotificationRule, error)
FindNotificationRuleByID returns a single notification rule by ID.
func (*RuleService) FindNotificationRules ¶
func (s *RuleService) FindNotificationRules(ctx context.Context, filter influxdb.NotificationRuleFilter, opt ...influxdb.FindOptions) (nrs []influxdb.NotificationRule, n int, err error)
FindNotificationRules returns a list of notification rules that match filter and the total count of matching notification rules. Additional options provide pagination & sorting.
func (*RuleService) PatchNotificationRule ¶
func (s *RuleService) PatchNotificationRule(ctx context.Context, id platform.ID, upd influxdb.NotificationRuleUpdate) (influxdb.NotificationRule, error)
PatchNotificationRule updates a single notification rule with changeset. Returns the new notification rule state after update.
func (*RuleService) PutNotificationRule ¶
func (s *RuleService) PutNotificationRule(ctx context.Context, nr influxdb.NotificationRuleCreate) error
PutNotificationRule put a notification rule to storage.
func (*RuleService) UpdateNotificationRule ¶
func (s *RuleService) UpdateNotificationRule(ctx context.Context, id platform.ID, nr influxdb.NotificationRuleCreate, userID platform.ID) (influxdb.NotificationRule, error)
UpdateNotificationRule updates a single notification rule. Returns the new notification rule after update.