Documentation
¶
Overview ¶
Package notification manages notification channel configurations and dispatches test events to verify connectivity.
Index ¶
- Variables
- type Config
- type CreateRequest
- type Service
- func (s *Service) Create(ctx context.Context, req CreateRequest) (Config, error)
- func (s *Service) Delete(ctx context.Context, id string) error
- func (s *Service) Get(ctx context.Context, id string) (Config, error)
- func (s *Service) List(ctx context.Context) ([]Config, error)
- func (s *Service) Test(ctx context.Context, id string) error
- func (s *Service) Update(ctx context.Context, id string, req UpdateRequest) (Config, error)
- type UpdateRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("notification not found")
ErrNotFound is returned when a notification config does not exist.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ID string
Name string
Kind string // "webhook", "discord", "email"
Enabled bool
Settings json.RawMessage
OnEvents []string // event types this notification fires for
CreatedAt time.Time
UpdatedAt time.Time
}
Config is the domain representation of a stored notification configuration.
type CreateRequest ¶
type CreateRequest struct {
Name string
Kind string
Enabled bool
Settings json.RawMessage
OnEvents []string
}
CreateRequest carries the fields needed to create a notification config.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service manages notification configurations.
func NewService ¶
NewService creates a new Service.
type UpdateRequest ¶
type UpdateRequest = CreateRequest
UpdateRequest carries the fields needed to update a notification config.
Click to show internal directories.
Click to hide internal directories.