teams

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fact

type Fact struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Section

type Section struct {
	ActivityTitle    string `json:"activityTitle,omitempty"`
	ActivitySubtitle string `json:"activitySubtitle,omitempty"`
	ActivityImage    string `json:"activityImage,omitempty"`
	Facts            []Fact `json:"facts,omitempty"`
	Text             string `json:"text,omitempty"` // Additional markdown content
}

type Target

type Target struct {
	OS  string `json:"os"`
	URI string `json:"uri"`
}

type TeamsAction

type TeamsAction struct {
	Type    string   `json:"@type"`
	Name    string   `json:"name"`
	Targets []Target `json:"targets"`
}

type TeamsMessage

type TeamsMessage struct {
	Type            string        `json:"@type"`                     // Always "MessageCard"
	Summary         string        `json:"summary"`                   // Required: Plain-text summary
	ThemeColor      string        `json:"themeColor,omitempty"`      // Optional: Color for the card (hexadecimal)
	Title           string        `json:"title,omitempty"`           // Title for the card
	Text            string        `json:"text,omitempty"`            // Main content (supports basic markdown)
	Sections        []Section     `json:"sections,omitempty"`        // Array of sections
	PotentialAction []TeamsAction `json:"potentialAction,omitempty"` // Array of actions
}

func (*TeamsMessage) ToString

func (tm *TeamsMessage) ToString() (string, error)

type TeamsNotifier

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

TeamsNotifier sends messages to Microsoft Teams via Incoming Webhook. It implements the Notifier interface.

func NewTeamsNotifier

func NewTeamsNotifier(request *entity.Request) *TeamsNotifier

NewTeamsNotifier creates a new TeamsNotifier with the provided request.

func (*TeamsNotifier) Send

func (t *TeamsNotifier) Send(message entity.Message) error

Send sends a Teams message via webhook. It supports facts and actions. The message must be of type *TeamsMessage.

Jump to

Keyboard shortcuts

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