slack

package
v0.0.0-...-d31a008 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ViewHomeCallbackID        = "cinderella_home"
	ViewClaimCallbackID       = "cinderella_claim"
	ViewClaimSubmitCallbackID = "cinderella_claim_submit"
	ViewRejectCallbackID      = "cinderella_claim_reject"
)
View Source
const (
	ActionDownloadKubeconfig = "download_kubeconfig"
	ActionCreateClaim        = "create_claim"
	ActionAccept             = "accept"
	ActionReject             = "reject"

	BlockDownloadKubeconfig = "download_kubeconfig"
	BlockPermit             = "permit"
)

Variables

View Source
var ErrClaimAlreadyExist = fmt.Errorf("Claim already exist")

Functions

func BuildClaimModalView

func BuildClaimModalView() (*slack.Blocks, error)

func ClaimToBlock

func ClaimToBlock(c model.Claim) slack.Block

Types

type AcceptController

type AcceptController struct {
}

func NewAcceptController

func NewAcceptController() AcceptController

func (*AcceptController) Accept

func (c *AcceptController) Accept(userId string) error

type ClaimController

type ClaimController struct {
	Slack *SlackApp
	// contains filtered or unexported fields
}

func NewClaimController

func NewClaimController(slack *SlackApp, claimRepository repository.ClaimRepository) *ClaimController

func (*ClaimController) IsClaimAlreadyExistError

func (c *ClaimController) IsClaimAlreadyExistError(err error) bool

func (*ClaimController) RegisterClaim

func (c *ClaimController) RegisterClaim(callback slack.InteractionCallback) (*model.Claim, error)

func (*ClaimController) Show

func (c *ClaimController) Show(userID, triggerID string) error

type ClaimEventHandler

type ClaimEventHandler struct {
	// contains filtered or unexported fields
}

func NewClaimEventHandler

func NewClaimEventHandler(ch <-chan event.ClaimEvent, api *slack.Client) *ClaimEventHandler

func (*ClaimEventHandler) Start

func (h *ClaimEventHandler) Start()

type HomeController

type HomeController struct {
	// contains filtered or unexported fields
}

func NewHomeController

func NewHomeController(slack *slack.Client, claimRepository repository.ClaimRepository) *HomeController

func (*HomeController) PublishView

func (c *HomeController) PublishView(userID string, withErrors ...error) error

type KubeconfigController

type KubeconfigController struct {
	// contains filtered or unexported fields
}

func NewKubeconfigController

func NewKubeconfigController(slack *slack.Client, claimRepository repository.ClaimRepository) *KubeconfigController

func (*KubeconfigController) CallbackClaimNotFound

func (c *KubeconfigController) CallbackClaimNotFound(channelId string) error

func (*KubeconfigController) SendSlackDM

func (c *KubeconfigController) SendSlackDM(subject string) error

type RejectController

type RejectController struct {
}

func NewRejectController

func NewRejectController() RejectController

func (*RejectController) Reject

func (c *RejectController) Reject(userId string) error

type SlackApp

type SlackApp struct {
	Api    *slack.Client
	Socket *socketmode.Client
	// contains filtered or unexported fields
}

SlackApp App

func NewSlackApp

func NewSlackApp(administrators []string) *SlackApp

func (*SlackApp) IsAdmin

func (s *SlackApp) IsAdmin(slackID string) bool

func (*SlackApp) Start

func (s *SlackApp) Start()

Jump to

Keyboard shortcuts

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