notification

package
v0.0.0-...-5c09a0a Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 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 File

type File struct {
	PullRequest     Notification `yaml:"pullRequest,omitempty"`
	Commit          Notification `yaml:"commit,omitempty"`
	PrettyName      []string     `yaml:"prettyName,omitempty"`
	MessageTemplate string       `yaml:"messageTemplate,omitempty"`
	// Parent is the notification file in the Parent directory. If there is none, it's an empty file.
	Parent      *File  `yaml:"-"` // This is used to allow us to merge the Parent with the child
	ChangedFile string `yaml:"-"` // Which files were changed that caused this notification file to be used
}

func (*File) AllGroups

func (f *File) AllGroups(changeType config.ChangeType) []string

func (*File) AllUsers

func (f *File) AllUsers(changeType config.ChangeType) []string

func (*File) Channel

func (f *File) Channel(changeType config.ChangeType) string

func (*File) Groups

func (f *File) Groups(changeType config.ChangeType) []string

func (*File) ProcessTemplate

func (f *File) ProcessTemplate(changeType config.ChangeType) (string, error)

func (*File) String

func (f *File) String() string

func (*File) Users

func (f *File) Users(changeType config.ChangeType) []string

type Loader

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

func NewLoader

func NewLoader(ghClient *ghclient.GhClient) *Loader

func (*Loader) LoadForPath

func (n *Loader) LoadForPath(ctx context.Context, path string) (*File, error)

type Merger

type Merger struct {
	NotificationLoader *Loader
}

func NewMerger

func NewMerger(notificationLoader *Loader) *Merger

func (*Merger) Merge

func (n *Merger) Merge(ctx context.Context, path string) (*File, error)

type Notification

type Notification struct {
	// Which Slack channel to notify on a change
	Channel string `yaml:"channel,omitempty"`
	// Which users to tag in the notification
	Users           []string `yaml:"users,omitempty"`
	Groups          []string `yaml:"groups,omitempty"`
	MessageTemplate string   `yaml:"messageTemplate,omitempty"`
}

Jump to

Keyboard shortcuts

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