bridge

package
v0.0.0-...-dc6244c Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bridge

type Bridge struct {
	// contains filtered or unexported fields
}

Bridge encapsulates all the long-term state of the bridge.

func New

func New(config Config, token string) (*Bridge, error)

New constructs a new Bridge object.

func (*Bridge) Run

func (b *Bridge) Run(ctx context.Context) error

Run the bridge until ctx is canceled.

type Config

type Config struct {
	Mattermost      MattermostConfig       `yaml:"mattermost"`
	PrettierOptions map[string]interface{} `yaml:"prettier"`
	// Mappings represents the list of Mattermost channel to Zephyr triplet pairings.
	// If multiple mappings match a Zephyrgram, the first one will be used.
	Mappings []Mapping `yaml:"mappings"`
}

Config represents the configuration for the Mattermost-Zephyr bridge.

type Mapping

type Mapping struct {
	Channel  string `yaml:"channel"`
	Class    string `yaml:"class"`
	Instance string `yaml:"instance"`
	// The diversion map maps Zephyr usernames to alternative Mattermost channels.
	// This is useful, for example, to redirect high-spew automated messages to
	// another channel so that the main channel is usable.
	Diversions map[string]string `yaml:"diversions"`
}

Mapping objects represent a single pairing of Mattermost channel and Zephyr triplet.

type MattermostConfig

type MattermostConfig struct {
	URL string `yaml:"url"`
}

MattermostConfig represents the configuration for connecting to Mattermost.

Jump to

Keyboard shortcuts

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