Documentation ¶
Index ¶
- Constants
- func NewChannelDest(id string) gadb.DestV1
- func NewDirectMessageDest(id string) gadb.DestV1
- func NewUsergroupDest(groupID, channelID string) gadb.DestV1
- func Signature(signingSecret string, ts time.Time, data []byte) string
- type Channel
- type ChannelSender
- func (s *ChannelSender) Channel(ctx context.Context, channelID string) (*Channel, error)
- func (s *ChannelSender) DMSender() *DMSender
- func (s *ChannelSender) DisplayInfo(ctx context.Context, args map[string]string) (*nfydest.DisplayInfo, error)
- func (s *ChannelSender) FieldLabel(ctx context.Context, fieldID, value string) (string, error)
- func (s *ChannelSender) ID() string
- func (s *ChannelSender) ListChannels(ctx context.Context) ([]Channel, error)
- func (s *ChannelSender) ListUserGroups(ctx context.Context) ([]UserGroup, error)
- func (s *ChannelSender) SearchField(ctx context.Context, fieldID string, options nfydest.SearchOptions) (*nfydest.SearchResult, error)
- func (s *ChannelSender) SendMessage(ctx context.Context, msg notification.Message) (*notification.SentMessage, error)
- func (s *ChannelSender) ServeMessageAction(w http.ResponseWriter, req *http.Request)
- func (s *ChannelSender) SetReceiver(r notification.Receiver)
- func (s *ChannelSender) Team(ctx context.Context, id string) (t *Team, err error)
- func (s *ChannelSender) TeamID(ctx context.Context) (string, error)
- func (s *ChannelSender) TypeInfo(ctx context.Context) (*nfydest.TypeInfo, error)
- func (s *ChannelSender) User(ctx context.Context, id string) (*User, error)
- func (s *ChannelSender) UserGroup(ctx context.Context, id string) (*UserGroup, error)
- func (s *ChannelSender) UserGroupSender() *UserGroupSender
- func (s *ChannelSender) ValidateChannel(ctx context.Context, id string) error
- func (s *ChannelSender) ValidateField(ctx context.Context, fieldID, value string) error
- func (s *ChannelSender) ValidateUser(ctx context.Context, id string) error
- func (s *ChannelSender) ValidateUserGroup(ctx context.Context, id string) error
- type Config
- type DMSender
- type Team
- type User
- type UserGroup
- type UserGroupSender
- func (ug *UserGroupSender) DisplayInfo(ctx context.Context, args map[string]string) (*nfydest.DisplayInfo, error)
- func (ug *UserGroupSender) FieldLabel(ctx context.Context, fieldID, value string) (string, error)
- func (ug *UserGroupSender) ID() string
- func (ug *UserGroupSender) SearchField(ctx context.Context, fieldID string, options nfydest.SearchOptions) (*nfydest.SearchResult, error)
- func (s *UserGroupSender) SendMessage(ctx context.Context, msg notification.Message) (*notification.SentMessage, error)
- func (ug *UserGroupSender) TypeInfo(ctx context.Context) (*nfydest.TypeInfo, error)
- func (ug *UserGroupSender) ValidateField(ctx context.Context, fieldID, value string) error
Constants ¶
View Source
const ( DestTypeSlackDirectMessage = "builtin-slack-dm" DestTypeSlackChannel = "builtin-slack-channel" DestTypeSlackUsergroup = "builtin-slack-usergroup" FieldSlackUserID = "slack_user_id" FieldSlackChannelID = "slack_channel_id" FieldSlackUsergroupID = "slack_usergroup_id" FallbackIconURL = "builtin://slack" )
Variables ¶
This section is empty.
Functions ¶
func NewChannelDest ¶ added in v0.33.0
func NewDirectMessageDest ¶ added in v0.33.0
func NewUsergroupDest ¶ added in v0.33.0
Types ¶
type Channel ¶
Channel contains information about a Slack channel.
func (Channel) AsField ¶ added in v0.33.0
func (c Channel) AsField() nfydest.FieldValue
type ChannelSender ¶
type ChannelSender struct {
// contains filtered or unexported fields
}
func NewChannelSender ¶
func NewChannelSender(ctx context.Context, cfg Config) (*ChannelSender, error)
func (*ChannelSender) DMSender ¶ added in v0.31.0
func (s *ChannelSender) DMSender() *DMSender
DMSender returns a new DMSender wrapping the given ChannelSender.
func (*ChannelSender) DisplayInfo ¶ added in v0.33.0
func (s *ChannelSender) DisplayInfo(ctx context.Context, args map[string]string) (*nfydest.DisplayInfo, error)
func (*ChannelSender) FieldLabel ¶ added in v0.33.0
func (*ChannelSender) ID ¶ added in v0.33.0
func (s *ChannelSender) ID() string
func (*ChannelSender) ListChannels ¶
func (s *ChannelSender) ListChannels(ctx context.Context) ([]Channel, error)
ListChannels will return a list of channels visible to the slack bot.
func (*ChannelSender) ListUserGroups ¶ added in v0.31.0
func (s *ChannelSender) ListUserGroups(ctx context.Context) ([]UserGroup, error)
ListUserGroups will return a list of all Slack user groups.
func (*ChannelSender) SearchField ¶ added in v0.33.0
func (s *ChannelSender) SearchField(ctx context.Context, fieldID string, options nfydest.SearchOptions) (*nfydest.SearchResult, error)
func (*ChannelSender) SendMessage ¶ added in v0.33.0
func (s *ChannelSender) SendMessage(ctx context.Context, msg notification.Message) (*notification.SentMessage, error)
func (*ChannelSender) ServeMessageAction ¶ added in v0.29.0
func (s *ChannelSender) ServeMessageAction(w http.ResponseWriter, req *http.Request)
func (*ChannelSender) SetReceiver ¶ added in v0.29.0
func (s *ChannelSender) SetReceiver(r notification.Receiver)
func (*ChannelSender) TeamID ¶ added in v0.28.0
func (s *ChannelSender) TeamID(ctx context.Context) (string, error)
func (*ChannelSender) UserGroupSender ¶ added in v0.31.0
func (s *ChannelSender) UserGroupSender() *UserGroupSender
UserGroupSender returns a new UserGroupSender wrapping the given ChannelSender.
func (*ChannelSender) ValidateChannel ¶ added in v0.33.0
func (s *ChannelSender) ValidateChannel(ctx context.Context, id string) error
func (*ChannelSender) ValidateField ¶ added in v0.33.0
func (s *ChannelSender) ValidateField(ctx context.Context, fieldID, value string) error
func (*ChannelSender) ValidateUser ¶ added in v0.33.0
func (s *ChannelSender) ValidateUser(ctx context.Context, id string) error
func (*ChannelSender) ValidateUserGroup ¶ added in v0.33.0
func (s *ChannelSender) ValidateUserGroup(ctx context.Context, id string) error
type DMSender ¶ added in v0.31.0
type DMSender struct {
*ChannelSender
}
DMSender wraps a ChannelSender with DM-specific functionality.
func (*DMSender) DisplayInfo ¶ added in v0.33.0
type Team ¶ added in v0.32.0
Team contains information about a Slack team.
func (Team) ChannelLink ¶ added in v0.32.0
type UserGroup ¶ added in v0.31.0
func (UserGroup) AsField ¶ added in v0.33.0
func (ug UserGroup) AsField() nfydest.FieldValue
type UserGroupSender ¶ added in v0.31.0
type UserGroupSender struct {
*ChannelSender
}
UserGroupSender processes on-call notifications by updating the members of a Slack user group.
func (*UserGroupSender) DisplayInfo ¶ added in v0.33.0
func (ug *UserGroupSender) DisplayInfo(ctx context.Context, args map[string]string) (*nfydest.DisplayInfo, error)
func (*UserGroupSender) FieldLabel ¶ added in v0.33.0
func (*UserGroupSender) ID ¶ added in v0.33.0
func (ug *UserGroupSender) ID() string
func (*UserGroupSender) SearchField ¶ added in v0.33.0
func (ug *UserGroupSender) SearchField(ctx context.Context, fieldID string, options nfydest.SearchOptions) (*nfydest.SearchResult, error)
func (*UserGroupSender) SendMessage ¶ added in v0.33.0
func (s *UserGroupSender) SendMessage(ctx context.Context, msg notification.Message) (*notification.SentMessage, error)
Send implements notification.Sender.
func (*UserGroupSender) ValidateField ¶ added in v0.33.0
func (ug *UserGroupSender) ValidateField(ctx context.Context, fieldID, value string) error
Click to show internal directories.
Click to hide internal directories.