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) 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 ¶
View Source
const ( TypeSlack string = "slack" TypeHTTP string = "http" TypePagerDuty string = "pagerduty" TypeFile string = "file" )
Variables ¶
View Source
var (
ErrNotImplemented = errors.New("operation not supported")
)
View Source
var SupportedTypes = []string{ TypeSlack, TypeHTTP, TypePagerDuty, TypeFile, }
Functions ¶
func IsTypeSupported ¶ added in v0.5.0
Types ¶
type ConfigResolver ¶ added in v0.5.0
type ConfigResolver interface { BuildData(ctx context.Context, configs map[string]interface{}) (map[string]interface{}, error) PreHookDBTransformConfigs(ctx context.Context, configs map[string]interface{}) (map[string]interface{}, error) PostHookDBTransformConfigs(ctx context.Context, configs map[string]interface{}) (map[string]interface{}, 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 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]interface{} `json:"configurations"` Data map[string]interface{} `json:"data"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` // 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
Source Files ¶
Click to show internal directories.
Click to hide internal directories.