Help us shape the future of Go! Take the 2026 Go Developer Survey

httpreceiver

package
v0.5.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

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) Notify

func (s *PluginService) Notify(ctx context.Context, apiURL string, body []byte) error

func (*PluginService) PreHookDBTransformConfigs

func (s *PluginService) PreHookDBTransformConfigs(ctx context.Context, receiverConfigMap map[string]interface{}) (map[string]interface{}, error)

func (*PluginService) PreHookQueueTransformConfigs

func (s *PluginService) PreHookQueueTransformConfigs(ctx context.Context, notificationConfigMap map[string]interface{}) (map[string]interface{}, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL