shoutrrr: Index | Files

package mattermost

import ""


Package Files

mattermost.go mattermost_config.go mattermost_json.go

func CreateJSONPayload Uses

func CreateJSONPayload(config *Config, message string, params *types.Params) ([]byte, error)

CreateJSONPayload for usage with the mattermost service

type Config Uses

type Config struct {
    UserName string
    Channel  string
    Host     string
    Token    string

Config object holding all information

func (*Config) GetURL Uses

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

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

func (*Config) SetURL Uses

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

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

type ErrorMessage Uses

type ErrorMessage string

ErrorMessage for error events within the mattermost service

const (
    // Scheme is the identifying part of this service's configuration URL
    Scheme = "mattermost"
    // NotEnoughArguments provided in the service URL
    NotEnoughArguments ErrorMessage = "the apiURL does not include enough arguments, either provide 1 or 3 arguments (they may be empty)"

type JSON Uses

type JSON struct {
    Text     string `json:"text"`
    UserName string `json:"username,omitempty"`
    Channel  string `json:"channel,omitempty"`

JSON payload for mattermost notifications

type Service Uses

type Service struct {
    // contains filtered or unexported fields

Service sends notifications to a pre-configured channel or user

func (*Service) Initialize Uses

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 Uses

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

Send a notification message to Mattermost

Package mattermost imports 10 packages (graph) and is imported by 1 packages. Updated 2020-07-04. Refresh now. Tools for package owners.