teamsnote

package module
v0.0.0-...-b7aabf0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: MIT Imports: 6 Imported by: 0

README

go-teams-notification

Send notification to a MS Teams channel.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

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

Action is a sum type, but only those of OpenUri are listed.

func NewOpenURIAction

func NewOpenURIAction(name string, targets []Target) Action

type Fact

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

type MessageCard

type MessageCard struct {
	Type       string    `json:"@type"`
	Context    string    `json:"@context"`
	ThemeColor string    `json:"themeColor"`
	Summary    string    `json:"summary"`
	Sections   []Section `json:"sections"`
	Actions    []Action  `json:"potentialAction"`
}

func NewMessageCard

func NewMessageCard(
	summary string,
	sections []Section,
	actions []Action,
) MessageCard

type Section

type Section struct {
	ActivityTitle    string `json:"activityTitle"`
	ActivitySubtitle string `json:"activitySubtitle"`
	ActivityImageURI string `json:"activityImage"`
	Facts            []Fact `json:"facts"`
}

type SendNotificationFunc

type SendNotificationFunc func(ctx context.Context, card MessageCard) error

func SendTeamsNotification

func SendTeamsNotification(
	webHookURL string,
) SendNotificationFunc

type Target

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

func NewTarget

func NewTarget(uri string) Target

Jump to

Keyboard shortcuts

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