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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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