Documentation ¶
Index ¶
- func NewMattermostApp(conf *Config) *common.BaseApp
- type Attachment
- type Bot
- func (b Bot) BroadcastAccessRequestMessage(ctx context.Context, recipients []common.Recipient, reqID string, ...) (accessrequest.SentMessages, error)
- func (b Bot) CheckHealth(ctx context.Context) error
- func (b Bot) FetchRecipient(ctx context.Context, name string) (*common.Recipient, error)
- func (b Bot) GetMe(ctx context.Context) (User, error)
- func (b Bot) LookupChannel(ctx context.Context, team, name string) (string, error)
- func (b Bot) LookupDirectChannel(ctx context.Context, email string) (string, error)
- func (b Bot) PostReviewReply(ctx context.Context, channelID, rootID string, review types.AccessReview) error
- func (b Bot) SendReviewReminders(ctx context.Context, recipients []common.Recipient, ...) error
- func (b Bot) SupportedApps() []common.App
- func (b Bot) UpdateMessages(ctx context.Context, reqID string, reqData pd.AccessRequestData, ...) error
- type Channel
- type Config
- type ErrorResult
- type MattermostConfig
- type Post
- type PostAction
- type PostActionIntegration
- type Props
- type Team
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMattermostApp ¶
Types ¶
type Attachment ¶
type Attachment struct { ID int64 `json:"id"` Text string `json:"text"` Actions []PostAction `json:"actions,omitempty"` }
type Bot ¶
type Bot struct {
// contains filtered or unexported fields
}
Bot is a Mattermost client that works with access.Request.
func (Bot) BroadcastAccessRequestMessage ¶
func (b Bot) BroadcastAccessRequestMessage(ctx context.Context, recipients []common.Recipient, reqID string, reqData pd.AccessRequestData) (accessrequest.SentMessages, error)
BroadcastAccessRequestMessage posts request info to Mattermost.
func (Bot) FetchRecipient ¶
FetchRecipient returns the recipient for the given raw recipient.
func (Bot) LookupChannel ¶
LookupChannel fetches channel id by its name and team name.
func (Bot) LookupDirectChannel ¶
LookupDirectChannel fetches user's direct message channel id by email.
func (Bot) PostReviewReply ¶
func (Bot) SendReviewReminders ¶
func (b Bot) SendReviewReminders(ctx context.Context, recipients []common.Recipient, accessList *accesslist.AccessList) error
SendReviewReminders will send a review reminder that an access list needs to be reviewed.
func (Bot) SupportedApps ¶
SupportedApps are the apps supported by this bot.
func (Bot) UpdateMessages ¶
func (b Bot) UpdateMessages(ctx context.Context, reqID string, reqData pd.AccessRequestData, mmData accessrequest.SentMessages, reviews []types.AccessReview) error
type Config ¶
type Config struct { common.BaseConfig Mattermost MattermostConfig `toml:"mattermost"` StatusSink common.StatusSink }
func LoadConfig ¶
func (*Config) CheckAndSetDefaults ¶
type ErrorResult ¶
type ErrorResult struct { ID string `json:"id"` Message string `json:"message"` DetailedError string `json:"detailed_error"` RequestID string `json:"request_id"` StatusCode int `json:"status_code"` }
func (ErrorResult) Error ¶
func (e ErrorResult) Error() string
type MattermostConfig ¶
type Post ¶
type Post struct { ID string `json:"id,omitempty"` ChannelID string `json:"channel_id"` Message string `json:"message"` RootID string `json:"root_id"` Props Props `json:"props"` }
func (Post) Attachments ¶
func (post Post) Attachments() []Attachment
type PostAction ¶
type PostAction struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Integration *PostActionIntegration `json:"integration,omitempty"` }
type PostActionIntegration ¶
Click to show internal directories.
Click to hide internal directories.