rocketchat

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Scheme is the identifying part of this service's configuration URL
	Scheme = "rocketchat"
	// NotEnoughArguments provided in the service URL
	NotEnoughArguments = "the apiURL does not include enough arguments"
)

Variables

This section is empty.

Functions

func CreateJSONPayload

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

CreateJSONPayload compatible with the rocket.chat webhook api

Types

type Config

type Config struct {
	standard.EnumlessConfig
	UserName string `url:"user" optional:""`
	Host     string `url:"host"`
	Port     string `url:"port"`
	TokenA   string `url:"path1"`
	Channel  string `url:"path3"`
	TokenB   string `url:"path2"`
}

Config for the rocket.chat service

func CreateConfigFromURL

func CreateConfigFromURL(_ types.ConfigQueryResolver, serviceURL *url.URL) (*Config, error)

CreateConfigFromURL to use within the rocket.chat service

func (*Config) GetURL

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

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

func (*Config) SetURL

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

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

type JSON

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

JSON used within the Rocket.chat service

type Service

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

Service sends notifications to a pre-configured channel or user

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 Rocket.chat

Jump to

Keyboard shortcuts

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