slack

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusDeployed string = "deployed"
	StatusFailed   string = "failed"
)

Variables

This section is empty.

Functions

func TokenToSlackIntegration

func TokenToSlackIntegration(token *oauth2.Token) (*integrations.SlackIntegration, error)

Types

type DeploymentStatus

type DeploymentStatus string

type Notifier

type Notifier interface {
	Notify(opts *NotifyOpts) error
}

func NewSlackNotifier

func NewSlackNotifier(conf *types.NotificationConfig, slackInts ...*integrations.SlackIntegration) Notifier

type NotifyOpts

type NotifyOpts struct {
	// ProjectID is the id of the Porter project that this deployment belongs to
	ProjectID uint

	// ClusterID is the id of the Porter cluster that this deployment belongs to
	ClusterID uint

	// ClusterName is the name of the cluster that this deployment was deployed in
	ClusterName string

	// Status is the current status of the deployment.
	Status string

	// Info is any additional information about this status, such as an error message if
	// the deployment failed.
	Info string

	// Name is the name of the deployment that this notification refers to.
	Name string

	// Namespace is the Kubernetes namespace of the deployment that this notification refers to.
	Namespace string

	URL string

	Version int
}

type SlackBlock

type SlackBlock struct {
	Type string     `json:"type"`
	Text *SlackText `json:"text,omitempty"`
}

type SlackNotifier

type SlackNotifier struct {
	Config *types.NotificationConfig
	// contains filtered or unexported fields
}

func (*SlackNotifier) Notify

func (s *SlackNotifier) Notify(opts *NotifyOpts) error

type SlackPayload

type SlackPayload struct {
	Blocks []*SlackBlock `json:"blocks"`
}

type SlackText

type SlackText struct {
	Type string `json:"type"`
	Text string `json:"text"`
}

Jump to

Keyboard shortcuts

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