teams

package
v0.0.0-...-a2f2a9e Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const BatchSize = 5

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	WebhookURL string `json:"webhook_url" validate:"required,url" required:"true"`
}

type Payload

type Payload struct {
	CardType   string    `json:"@type"`
	Context    string    `json:"@context"`
	Markdown   bool      `json:"markdown"`
	Text       string    `json:"text,omitempty"`
	Title      string    `json:"title,omitempty"`
	Summary    string    `json:"summary,omitempty"`
	Sections   []section `json:"sections,omitempty"`
	ThemeColor string    `json:"themeColor,omitempty"`
}

Payloads

type Teams

type Teams 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"`
	// contains filtered or unexported fields
}

func New

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

func (Teams) FormatMessage

func (t Teams) FormatMessage(message map[string]interface{}, position int, entiremsg *strings.Builder) string

func (Teams) IsValidCredential

func (t Teams) IsValidCredential(ctx context.Context) (bool, error)

func (Teams) SendNotification

func (t Teams) SendNotification(ctx context.Context, message string, extras map[string]interface{}) error

func (Teams) Sender

func (t Teams) Sender(in chan *Payload, wg *sync.WaitGroup)

func (Teams) ValidateConfig

func (t Teams) ValidateConfig(validate *validator.Validate) error

Jump to

Keyboard shortcuts

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