httpapi

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server serves the HTTP API for triggering bot messages

func NewServer

func NewServer(bots map[string]*bot.Client, tokens map[string]string, logger *slog.Logger) *Server

NewServer creates a new HTTP API server

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler constructs the HTTP handler with routes and middleware

func (*Server) Start

func (s *Server) Start(addr string) error

Start starts the HTTP server on the given address

type Target

type Target struct {
	Username string `json:"username,omitempty"` // DM to username
	Channel  string `json:"channel,omitempty"`  // Post to channel (with or without #)
	RoomID   string `json:"roomId,omitempty"`   // Post to room ID directly
}

Target represents a structured message destination

Jump to

Keyboard shortcuts

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