alert

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type PagerdutyCredential

type PagerdutyCredential struct {
	gorm.Model
	ServiceKey string
	TeamName   string `gorm:"uniqueIndex:team_unique"`
	Entity     string
}

type Repository

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

func NewRepository

func NewRepository(db *gorm.DB) *Repository

func (Repository) GetCredential

func (r Repository) GetCredential(teamName string) (map[string]SlackCredential, PagerdutyCredential, error)

func (Repository) UpsertPagerduty

func (r Repository) UpsertPagerduty(credential PagerdutyCredential) error

func (Repository) UpsertSlack

func (r Repository) UpsertSlack(credential SlackCredential) error

type Service

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

func (Service) Get

func (s Service) Get(teamName string) (domain.AlertCredential, error)

func (Service) Migrate

func (s Service) Migrate() error

func (Service) Upsert

func (s Service) Upsert(credential domain.AlertCredential) error

type SlackCredential

type SlackCredential struct {
	gorm.Model
	ChannelName string
	Username    string
	Webhook     string
	Level       string `gorm:"uniqueIndex:team_level_unique"`

	TeamName string `gorm:"uniqueIndex:team_level_unique"`
	Entity   string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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