zulip

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: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Scheme is the identifying part of this service's configuration URL
	Scheme = "zulip"
)

Variables

This section is empty.

Functions

func CreatePayload

func CreatePayload(config *Config, message string) url.Values

CreatePayload compatible with the zulip api

Types

type Config

type Config struct {
	standard.EnumlessConfig
	BotMail string `url:"user" desc:"Bot e-mail address"`
	BotKey  string `url:"pass" desc:"API Key"`
	Host    string `url:"host,port" desc:"API server hostname"`
	Stream  string `key:"stream" optional:"" description:"Target stream name"`
	Topic   string `key:"topic,title" default:""`
}

Config for the zulip service

func CreateConfigFromURL

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

CreateConfigFromURL to use within the zulip service

func (*Config) Clone

func (config *Config) Clone() *Config

Clone the config to a new Config struct

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(url *url.URL) error

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

type ErrorMessage

type ErrorMessage string

ErrorMessage for error events within the zulip service

const (
	// MissingAPIKey from the service URL
	MissingAPIKey ErrorMessage = "missing API key"
	// MissingHost from the service URL
	MissingHost ErrorMessage = "missing Zulip host"
	// MissingBotMail from the service URL
	MissingBotMail ErrorMessage = "missing Bot mail address"
	// TopicTooLong if topic is more than 60 characters
	TopicTooLong ErrorMessage = "topic exceeds max length (%d characters): was %d characters"
)

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 Zulip

Jump to

Keyboard shortcuts

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