notifications

package
v0.2.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Type     string `json:"type"`
	Text     *Text  `json:"text,omitempty"`
	Elements []Text `json:"elements,omitempty"`
}

type GitopsEvent

type GitopsEvent struct {
	Manifest    *dx.Manifest
	Artifact    *dx.Artifact
	TriggeredBy string

	Status     Status
	StatusDesc string

	GitopsRef  string
	GitopsRepo string
}

type Manager

type Manager interface {
	Broadcast(msg Message)
	AddProvider(provider string, token string, defaultChannel string, channelMapping string)
}

type ManagerImpl

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

func NewManager

func NewManager() *ManagerImpl

func (*ManagerImpl) AddProvider

func (m *ManagerImpl) AddProvider(providerType string, token string, defaultChannel string, channelMapping string)

func (*ManagerImpl) Broadcast

func (m *ManagerImpl) Broadcast(msg Message)

func (*ManagerImpl) Run

func (m *ManagerImpl) Run()

type Message

type Message interface {
	AsSlackMessage() (*slackMessage, error)
	AsGithubStatus() (*githubLib.RepoStatus, error)
	Env() string
	RepositoryName() string
	SHA() string
}

func MessageFromFluxEvent

func MessageFromFluxEvent(gitopsRepo string, event *recorder.Event) Message

func MessageFromGitOpsEvent

func MessageFromGitOpsEvent(event *GitopsEvent) Message

type Status

type Status int
const (
	Success Status = iota
	Failure
)

type Text

type Text 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