Documentation
¶
Overview ¶
Package notify defines interfaces each supported notification destination should implement.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Destination ¶
Destination defines interface for a given destination service, like telegram, email or stdout.
type Destinations ¶ added in v0.2.0
type Destinations []Destination
Destinations is an aggregation of notifiers.
func (Destinations) Send ¶ added in v0.2.0
func (d Destinations) Send(ctx context.Context, tagName, text string) error
Send sends the message to all destinations.
func (Destinations) String ¶ added in v0.2.0
func (d Destinations) String() string
String returns the names of all destinations.
type Github ¶
type Github struct {
GithubParams
// contains filtered or unexported fields
}
Github makes a new release on Github on the given version.
func NewGithub ¶
func NewGithub(params GithubParams) (*Github, error)
NewGithub makes new instance of Github.
type GithubParams ¶
type GithubParams struct {
Owner string
Name string
BasicAuthUsername string
BasicAuthPassword string
HTTPClient http.Client
ReleaseNameTmplText string
}
GithubParams describes parameters to initialize github releaser.
type MattermostBot ¶ added in v0.5.0
type MattermostBot struct {
MattermostBotParams
// contains filtered or unexported fields
}
MattermostBot is a notifier for MattermostBot.
func NewMattermostBot ¶ added in v0.5.0
func NewMattermostBot(params MattermostBotParams) (*MattermostBot, error)
NewMattermostBot makes a new MattermostBot notifier.
func (*MattermostBot) Send ¶ added in v0.5.0
func (m *MattermostBot) Send(ctx context.Context, _, text string) error
Send sends a message to Mattermost.
func (*MattermostBot) String ¶ added in v0.5.0
func (m *MattermostBot) String() string
String returns the name of the notifier.
type MattermostBotParams ¶ added in v0.5.0
type MattermostBotParams struct {
Client http.Client
BaseURL string
ChannelID string
LoginID string
Password string
LDAP bool
}
MattermostBotParams are MattermostBot notifier params.
type MattermostHook ¶ added in v0.5.0
type MattermostHook struct {
// contains filtered or unexported fields
}
MattermostHook sends messages to Mattermost via webhook.
func NewMattermostHook ¶ added in v0.5.0
func NewMattermostHook(cl http.Client, baseURL, hookID string) *MattermostHook
NewMattermostHook makes a new MattermostHook notifier.
func (*MattermostHook) Send ¶ added in v0.5.0
func (m *MattermostHook) Send(ctx context.Context, _, text string) error
Send sends a message to Mattermost.
func (*MattermostHook) String ¶ added in v0.5.0
func (m *MattermostHook) String() string
String returns the name of the notifier.
type Post ¶ added in v0.6.0
Post sends a POST request to the given URL with release notes.
type Telegram ¶
type Telegram struct {
TelegramParams
}
Telegram implements Destination to send changelogs to specified telegram chats.
func NewTelegram ¶
func NewTelegram(params TelegramParams) *Telegram
NewTelegram makes telegram bot for notifications
type TelegramParams ¶
type TelegramParams struct {
Log *log.Logger
ChatID string
Client http.Client
Token string
DisableWebPagePreview bool
}
TelegramParams defines parameters needed to initialize Telegram notifier.
type WriterNotifier ¶
WriterNotifier prints the changelog to the specified writer. Writer might be os.Stdout, in order to use in pipelines and CI/CD.
func (*WriterNotifier) Send ¶
func (w *WriterNotifier) Send(_ context.Context, _, text string) error
Send writes changelog to writer.
func (*WriterNotifier) String ¶
func (w *WriterNotifier) String() string
String returns the string representation to identify this notifier.