teams

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// Scheme is the identifying part of this service's configuration URL
	Scheme = "teams"
	// LegacyHost is the default host for legacy webhook requests
	LegacyHost = "outlook.office.com"
	// LegacyPath is the initial path of the webhook URL for legacy webhook requests
	LegacyPath = "webhook"
	// Path is the initial path of the webhook URL for domain-scoped webhook requests
	Path = "webhookb2"
	// ProviderName is the name of the Teams integration provider
	ProviderName = "IncomingWebhook"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	standard.EnumlessConfig
	Group      string `url:"user" optional:""`
	Tenant     string `url:"host" optional:""`
	AltID      string `url:"path1" optional:""`
	GroupOwner string `url:"path2" optional:""`

	Title string `key:"title" optional:""`
	Color string `key:"color" optional:""`
	Host  string `key:"host" optional:"" default:"outlook.office.com"`
}

Config for use within the teams plugin

func ConfigFromWebhookURL added in v0.4.1

func ConfigFromWebhookURL(webhookURL url.URL) (*Config, error)

ConfigFromWebhookURL creates a new Config from a parsed Teams Webhook URL

func (*Config) GetURL

func (config *Config) GetURL() *url.URL

GetURL returns a URL representation of it's current field values

func (*Config) SetFromWebhookURL added in v0.4.0

func (config *Config) SetFromWebhookURL(webhookURL string) error

SetFromWebhookURL updates the config WebhookParts from a teams webhook URL

func (*Config) SetURL

func (config *Config) SetURL(url *url.URL) error

SetURL updates a ServiceConfig from a URL representation of it's field values

type Service

type Service struct {
	standard.Standard
	// contains filtered or unexported fields
}

Service providing teams as a notification service

func (*Service) GetConfigURLFromCustom added in v0.4.0

func (*Service) GetConfigURLFromCustom(customURL *url.URL) (serviceURL *url.URL, err error)

GetConfigURLFromCustom creates a regular service URL from one with a custom host

func (*Service) Initialize

func (service *Service) Initialize(configURL *url.URL, logger types.StdLogger) error

Initialize loads ServiceConfig from configURL and sets logger for this Service

func (*Service) Send

func (service *Service) Send(message string, params *types.Params) error

Send a notification message to Microsoft Teams

Jump to

Keyboard shortcuts

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