chatops

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package chatops is the chat-frontend-agnostic command dispatcher.

Both transports — the legacy /slash HTTP handler and the pull-mode WebSocket listener that natsie uses against Mattermost servers without outbound slash-command support — feed text through Dispatch and render the returned reply verbatim. Anything that wants to add a new sink (Slack RTM, Matrix, an IRC bridge) only needs to plug into Dispatch.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dispatch

func Dispatch(ctx context.Context, deps Deps, trigger string, argv []string) string

Dispatch parses the user's argv and returns the reply text to render. trigger is purely cosmetic — used to echo the right prefix in help.

func Help

func Help(trigger string) string

Help is the canned usage message. It's identical across transports so users who hop between web slash commands and chat triggers learn one vocabulary.

Types

type Deps added in v0.7.0

type Deps struct {
	Store      store.Store
	Audit      *audit.Logger
	BaseURL    string
	SigningKey string
}

Deps is the set of dependencies the chat commands need. Both transports (HTTP /slash and the pull-mode WebSocket listener) build one of these and pass it to Dispatch.

Store + Audit are always required. BaseURL + SigningKey are needed only by the on-demand scan command (which embeds a signed approve URL in its reply); other commands ignore them.

Jump to

Keyboard shortcuts

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