slack

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateComparisonMessage added in v0.1.0

func GenerateComparisonMessage(repo providers.Repository, fromRef, toRef providers.Ref, cmp providers.Comparison, slackUserID string) slack.Blocks

GenerateComparisonMessage ..

func GetModalRequest added in v0.1.0

func GetModalRequest(opts ModalRequestOptions) (mvr slack.ModalViewRequest)

GetModalRequest ..

Types

type ModalRequestOptions added in v0.1.0

type ModalRequestOptions struct {
	ConversationID                  string
	Repository                      providers.Repository
	FromRef                         providers.Ref
	ToRef                           providers.Ref
	Comparison                      *providers.Comparison
	LastRepositoriesUpdate          time.Time
	CurrentlyUpdatingRepositories   bool
	CurrentlyUpdatingRepositoryRefs bool
}

ModalRequestOptions ..

type NewOptions

type NewOptions struct {
	SigningSecret string
	Token         string
}

NewOptions holds configuration parameters to create a new and operational Slack object

type Slack

type Slack struct {
	Client        *slack.Client
	SigningSecret string
	CustomUsers   config.Users
}

Slack holds clients and configuration to perform operations upon the Slack API, git providers and storage/cache endpoints

func New

func New(cfg config.Slack, customUsers config.Users) (s Slack)

New creates and configures a new Slack object

func (*Slack) ListSlackUserEmailMappings added in v0.1.0

func (s *Slack) ListSlackUserEmailMappings() (mapping map[string]string, err error)

ListSlackUserEmailMappings returns a mapping between email addresses and slack user IDs

func (Slack) SendMessage added in v0.1.0

func (s Slack) SendMessage(channelID, msg string) (err error)

SendMessage on a given channel ID

func (Slack) VerifySigningSecret added in v0.1.0

func (s Slack) VerifySigningSecret(r *http.Request) error

VerifySigningSecret was taken from the slash example https://github.com/slack-go/slack/blob/master/examples/slash/slash.go

type ViewSubmissionResponse added in v0.1.0

type ViewSubmissionResponse struct {
	ResponseType string            `json:"response_type"`
	Errors       map[string]string `json:"errors,omitempty"`
}

ViewSubmissionResponse ..

Jump to

Keyboard shortcuts

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