teams

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 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"
	// DefaultHost is the default host for the webhook request
	DefaultHost = "outlook.office.com"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	standard.EnumlessConfig
	WebhookParts [4]string
	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 *log.Logger) 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