Documentation ¶
Index ¶
- Constants
- Variables
- func IsTypeSupported(receiverType string) bool
- type ConfigResolver
- type Encryptor
- type Filter
- type GetOption
- type NotFoundError
- type Receiver
- type Repository
- type Service
- func (s *Service) Create(ctx context.Context, rcv *Receiver) error
- func (s *Service) Delete(ctx context.Context, id uint64) error
- func (s *Service) ExpandParents(ctx context.Context, rcvs []Receiver) ([]Receiver, error)
- func (s *Service) Get(ctx context.Context, id uint64, gopts ...GetOption) (*Receiver, error)
- func (s *Service) List(ctx context.Context, flt Filter) ([]Receiver, error)
- func (s *Service) Update(ctx context.Context, rcv *Receiver) error
Constants ¶
Variables ¶
View Source
var (
ErrNotImplemented = errors.New("operation not supported")
)
View Source
var SupportedTypes = []string{ TypeSlack, TypeSlackChannel, TypeHTTP, TypePagerDuty, TypeFile, }
Functions ¶
func IsTypeSupported ¶
Types ¶
type ConfigResolver ¶
type ConfigResolver interface { BuildData(ctx context.Context, configs map[string]any) (map[string]any, error) PreHookDBTransformConfigs(ctx context.Context, configs map[string]any) (map[string]any, error) PostHookDBTransformConfigs(ctx context.Context, configs map[string]any) (map[string]any, error) }
ConfigResolver is an interface for the receiver to resolve all configs and function related to a specific receiver type. Receiver plugin needs to implement this interface for all configs and functionality resolution.
type GetOption ¶
type GetOption func(*getOpts)
func GetWithData ¶
func GetWithData() GetOption
func GetWithExpand ¶ added in v0.6.5
func GetWithExpand() GetOption
type NotFoundError ¶
type NotFoundError struct {
ID uint64
}
func (NotFoundError) Error ¶
func (err NotFoundError) Error() string
type Receiver ¶
type Receiver struct { ID uint64 `json:"id"` Name string `json:"name"` Labels map[string]string `json:"labels"` Configurations map[string]any `json:"configurations"` Data map[string]any `json:"data"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` // The pointer to receiver parent of a child receiver. This field is required if a receiver is a child receiver // If ParentID != 0, the receiver is a child receiver. ParentID uint64 `json:"parent_id"` // Type should be immutable Type string `json:"type"` }
type Repository ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles business logic
func NewService ¶
func NewService(repository Repository, receiverPlugins map[string]ConfigResolver) *Service
func (*Service) ExpandParents ¶ added in v0.6.5
Source Files ¶
Click to show internal directories.
Click to hide internal directories.