pagerduty

package
v0.0.0-...-d5826a0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BatchSize = 100
)

Variables

This section is empty.

Functions

func IsValidCreds

func IsValidCreds(p PagerDuty) (bool, error)

todo: implement this and make this method as part of the interface function that checks if the credential provided by the user is valid or not

Types

type Config

type Config struct {
	ServiceKey string `json:"service_key" validate:"required,min=1" required:"true"`
	APIKey     string `json:"api_key" validate:"required,min=1" required:"true"`
}

type PagerDuty

type PagerDuty struct {
	Config           Config                  `json:"config"`
	IntegrationType  string                  `json:"integration_type"`
	NotificationType string                  `json:"notification_type"`
	Filters          reporters.FieldsFilters `json:"filters"`
	Message          string                  `json:"message"`
	Resource         string                  `json:"resource"`
	Severity         string                  `json:"severity"`
}

func New

func New(ctx context.Context, b []byte) (*PagerDuty, error)

func (PagerDuty) FormatMessage

func (p PagerDuty) FormatMessage(message []map[string]interface{}) string

func (PagerDuty) IsValidCredential

func (p PagerDuty) IsValidCredential(ctx context.Context) (bool, error)

todo

func (PagerDuty) SendNotification

func (p PagerDuty) SendNotification(ctx context.Context, message []map[string]interface{}, extras map[string]interface{}) error
func (p PagerDuty) SendSummaryLink() bool

func (PagerDuty) ValidateConfig

func (p PagerDuty) ValidateConfig(validate *validator.Validate) error

type PagerDutyEvent

type PagerDutyEvent struct {
	RoutingKey  string                 `json:"routing_key"`
	EventAction string                 `json:"event_action"`
	Payload     map[string]interface{} `json:"payload"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳