slackchannel

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NotificationConfig

type NotificationConfig struct {
	ReceiverConfig `mapstructure:",squash"`
}

NotificationConfig has all configs needed to send notification

func (*NotificationConfig) AsMap

func (c *NotificationConfig) AsMap() map[string]any

func (*NotificationConfig) Validate

func (c *NotificationConfig) Validate() error

Validate validates whether notification config contains required fields or not channel_name is not mandatory because in NotifyToReceiver flow, channel_name is being passed from the request (not from the config)

type PluginService

type PluginService struct {
	base.UnimplementedService
	// contains filtered or unexported fields
}

PluginService is a plugin service layer for slack channel type

func NewPluginService

func NewPluginService(cfg slack.AppConfig, cryptoClient slack.Encryptor, opts ...slack.ServiceOption) *PluginService

NewPluginService returns slack channel plugin service struct. This service implement [receiver.Resolver] and notification.Notifier interface.

func (*PluginService) GetSystemDefaultTemplate

func (s *PluginService) GetSystemDefaultTemplate() string

func (*PluginService) PostHookDBTransformConfigs

func (s *PluginService) PostHookDBTransformConfigs(ctx context.Context, configurations map[string]any) (map[string]any, error)

PostHookTransformConfigs do transformation in post-hook service lifecycle

func (*PluginService) PostHookQueueTransformConfigs

func (s *PluginService) PostHookQueueTransformConfigs(ctx context.Context, notificationConfigMap map[string]any) (map[string]any, error)

func (*PluginService) PreHookDBTransformConfigs

func (s *PluginService) PreHookDBTransformConfigs(ctx context.Context, configurations map[string]any) (map[string]any, error)

func (*PluginService) PreHookQueueTransformConfigs

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

func (*PluginService) Send

func (s *PluginService) Send(ctx context.Context, notificationMessage notification.Message) (bool, error)

type ReceiverConfig

type ReceiverConfig struct {
	SlackReceiverConfig slack.ReceiverConfig `mapstructure:",squash"`
	ChannelName         string               `json:"channel_name" mapstructure:"channel_name"`
	ChannelType         string               `json:"channel_type" mapstructure:"channel_type"`
}

ReceiverConfig is a stored config for a slack receiver

func (*ReceiverConfig) AsMap

func (c *ReceiverConfig) AsMap() map[string]any

func (*ReceiverConfig) Validate

func (c *ReceiverConfig) Validate() error

Jump to

Keyboard shortcuts

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