Documentation ¶
Index ¶
- type AppConfig
- type NotificationConfig
- type PluginService
- func (s *PluginService) Notify(ctx context.Context, apiURL string, body []byte) error
- func (s *PluginService) PreHookDBTransformConfigs(ctx context.Context, receiverConfigMap map[string]interface{}) (map[string]interface{}, error)
- func (s *PluginService) PreHookQueueTransformConfigs(ctx context.Context, notificationConfigMap map[string]interface{}) (map[string]interface{}, error)
- func (s *PluginService) Send(ctx context.Context, notificationMessage notification.Message) (bool, error)
- type ReceiverConfig
- type ServiceOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppConfig ¶
type AppConfig struct { Retry retry.Config `mapstructure:"retry" yaml:"retry"` HTTPClient httpclient.Config `mapstructure:"http_client" yaml:"http_client"` }
AppConfig is a config loaded when siren is started
type NotificationConfig ¶
type NotificationConfig struct {
ReceiverConfig `mapstructure:",squash"`
}
func (*NotificationConfig) AsMap ¶
func (c *NotificationConfig) AsMap() map[string]interface{}
type PluginService ¶
type PluginService struct { base.UnimplementedService // contains filtered or unexported fields }
func NewPluginService ¶
func NewPluginService(logger log.Logger, cfg AppConfig, opts ...ServiceOption) *PluginService
func (*PluginService) PreHookDBTransformConfigs ¶
func (*PluginService) PreHookQueueTransformConfigs ¶
func (*PluginService) Send ¶
func (s *PluginService) Send(ctx context.Context, notificationMessage notification.Message) (bool, error)
type ReceiverConfig ¶
type ReceiverConfig struct {
URL string `mapstructure:"url"`
}
func (*ReceiverConfig) AsMap ¶
func (c *ReceiverConfig) AsMap() map[string]interface{}
func (*ReceiverConfig) Validate ¶
func (c *ReceiverConfig) Validate() error
type ServiceOption ¶
type ServiceOption func(*PluginService)
func WithHTTPClient ¶
func WithHTTPClient(httpClient *httpclient.Client) ServiceOption
WithHTTPClient assigns custom http client when creating a service
func WithRetrier ¶
func WithRetrier(runner retry.Runner) ServiceOption
WithRetrier wraps client call with retrier
Click to show internal directories.
Click to hide internal directories.