server

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 58 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package server exposes the Antares HTTP API and serves the built dashboard.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomProviderID added in v0.4.0

func CustomProviderID(cfg *config.Config, name string) string

CustomProviderID mints a unique config id for a user-named provider. A name that slugs to nothing (or to "custom" itself) becomes "custom-provider" — never the legacy "custom" slot, which no longer renders on the providers page, so a nameless setup still lands on a visible, manageable provider. The id avoids every built-in catalogue id and any provider already in the config; it is the single minter shared by the web API and both wizards.

func EmbeddedDist

func EmbeddedDist() fs.FS

EmbeddedDist returns the compiled dashboard, or nil when the binary was built without one (the dev flow).

func NeedsSetup

func NeedsSetup(cfg *config.Config) bool

NeedsSetup reports whether Antares can answer at all yet.

Types

type Options

type Options struct {
	Config *config.Config
	Agent  *agent.Agent
	Store  store.Store
	// Dist is the built dashboard to serve at "/". May be nil in dev, where
	// Vite serves the UI and proxies /api here.
	Dist fs.FS
	// Reload re-reads configuration from disk and rebuilds dependent services.
	Reload func() error
	// Skills, Cron, and Gateway are optional; their endpoints report
	// unavailability when nil.
	Skills  *skills.Manager
	Cron    *cron.Runner
	Gateway *gateway.Manager
	MCP     *mcp.Manager
	Social  *socialbrowser.Manager
}

Options configures a Server.

type Server

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

Server wires the API handlers to the agent and store.

func New

func New(o Options) *Server

New builds the HTTP server and registers every route.

func (*Server) Addr

func (s *Server) Addr() string

Addr returns the configured listen address.

func (*Server) Handler

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

Handler returns the root handler with middleware applied.

func (*Server) Serve

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

Serve runs the HTTP server until ctx is cancelled.

func (*Server) SetConfig

func (s *Server) SetConfig(cfg *config.Config)

SetConfig swaps the live configuration after a reload.

Jump to

Keyboard shortcuts

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