api

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelCreator

type ChannelCreator interface {
	CreateChannel(ctx context.Context, guildID, name string) (string, error)
}

ChannelCreator can create Discord channels.

type ChannelEnsurer

type ChannelEnsurer interface {
	EnsureChannel(ctx context.Context, dirPath string) (string, error)
}

ChannelEnsurer resolves a directory path to a Discord channel ID, creating the channel if it does not yet exist.

func NewChannelService

func NewChannelService(store db.Store, creator ChannelCreator, guildID string) ChannelEnsurer

NewChannelService creates a new ChannelEnsurer.

type Server

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

Server exposes a lightweight HTTP API for task CRUD operations.

func NewServer

func NewServer(sched scheduler.Scheduler, channels ChannelEnsurer, logger *slog.Logger) *Server

NewServer creates a new API server. The channels parameter may be nil if channel creation is not configured.

func (*Server) Start

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

Start starts the HTTP server on the given address.

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

Stop gracefully shuts down the HTTP server.

Jump to

Keyboard shortcuts

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