server

package
v0.0.0-...-8848e02 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package server wires the REST API (README §14) on top of Echo. It is a thin HTTP layer: all real logic lives in internal/tasks, internal/ watchers, internal/scheduler, internal/system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Tasks              *tasks.Store
	Watchers           *watchers.Service
	Schedules          *scheduler.Store
	Notifications      *notifications.Store
	DiskPath           string
	SlackSigningSecret string // empty = POST /slack/commands always rejects
}

Options bundles New's dependencies - grown past the point a positional parameter list stays readable.

type Server

type Server struct {
	Echo *echo.Echo
	// contains filtered or unexported fields
}

func New

func New(opts Options) *Server

type SocketModeClient

type SocketModeClient struct {
	AppToken   string // xapp-... token, Basic Information > App-Level Tokens, connections:write scope
	Server     *Server
	HTTPClient *http.Client
}

SocketModeClient runs Slack's Socket Mode protocol: an outbound WebSocket connection FROM LocalOps TO Slack, the opposite direction from POST /slack/commands. Slash commands arrive over this socket instead, so no public HTTP endpoint (Funnel, a reverse proxy, a signing secret) is needed at all - trade-off is Slack's Request URL field goes unused; this is the alternative delivery path, not an addition to it.

func NewSocketModeClient

func NewSocketModeClient(appToken string, s *Server) *SocketModeClient

func (*SocketModeClient) Run

func (c *SocketModeClient) Run(ctx context.Context)

Run connects and reconnects (with backoff) until ctx is cancelled. Meant to be launched as `go client.Run(ctx)` from main, alongside the HTTP server - the two are independent delivery paths for the same commands.

Jump to

Keyboard shortcuts

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