notifier

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accessory

type Accessory struct {
	Type     string         `json:"type,omitempty"`
	Text     *AccessoryText `json:"text,omitempty"`
	Value    string         `json:"value,omitempty"`
	URL      string         `json:"url,omitempty"`
	ActionID string         `json:"action_id,omitempty"`
}

type AccessoryText

type AccessoryText struct {
	Type  string `json:"type,omitempty"`
	Text  string `json:"text,omitempty"`
	Emoji bool   `json:"emoji,omitempty"`
}

type Block

type Block struct {
	Type      string     `json:"type,omitempty"`
	Text      *Text      `json:"text,omitempty"`
	Fields    []Text     `json:"fields,omitempty"`
	Accessory *Accessory `json:"accessory,omitempty"`
}

type Composer added in v0.6.0

type Composer struct {
	// contains filtered or unexported fields
}

Composer ...

func CreateComposer added in v0.6.0

func CreateComposer(ctx context.Context,
	logger log.Logger,
	cfg ComposerConfig) (*Composer, error)

CreateComposer ...

func (*Composer) Notify added in v0.6.0

func (s *Composer) Notify(ctx context.Context, opts application.NotifyOptions) error

type ComposerConfig added in v0.6.0

type ComposerConfig struct {
	Notifiers map[string]application.Notifier
}

type Slack

type Slack struct {
	// contains filtered or unexported fields
}

Slack ...

func CreateSlack

func CreateSlack(ctx context.Context,
	logger log.Logger,
	cfg SlackConfig) (*Slack, error)

CreateSlack ...

func (*Slack) Notify

func (s *Slack) Notify(ctx context.Context, opts application.NotifyOptions) error

type SlackConfig

type SlackConfig struct {
	WebhookURL  string
	BaseURL     string
	IconSuccess string
	IconError   string
	EnvInfoText string
}

type Text

type Text struct {
	Type string `json:"type,omitempty"`
	Text string `json:"text,omitempty"`
}

type Webhook added in v0.6.0

type Webhook struct {
	// contains filtered or unexported fields
}

Webhook ...

func CreateWebhook added in v0.6.0

func CreateWebhook(ctx context.Context,
	logger log.Logger,
	cfg WebhookConfig) (*Webhook, error)

CreateWebhook ...

func (*Webhook) Notify added in v0.6.0

func (s *Webhook) Notify(ctx context.Context, opts application.NotifyOptions) error

type WebhookConfig added in v0.6.0

type WebhookConfig struct {
	WebhookURL          string
	Method              string
	BodyTemplate        string
	QueryParamsTemplate string
	Insecure            bool
	Timeout             time.Duration
	AuthHeaderName      string
	AuthHeaderValue     string
	FireOn              []string
	LogTemplateResults  bool
}

Jump to

Keyboard shortcuts

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