app

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, logger log.Logger, cfg Config) error

Run starts the API server. If Postgres is not configured, it falls back to an in-memory SQLite database with a warning.

func Serve

func Serve(ctx context.Context, logger log.Logger, srv *server.Server) error

Serve starts the server and blocks until the context is cancelled.

Types

type Config

type Config struct {
	Port                     int
	UI                       bool
	Postgres                 PostgresConfig // If empty, uses SQLite
	SQLiteDir                string         // Directory for SQLite DB file; if empty, uses in-memory
	EncryptionKey            string         // Hex-encoded 32-byte key for encrypting secrets at rest
	GitHubInsecureSkipVerify bool           // Disable TLS certificate verification for GitHub API calls
	CorsOrigins              []string
	TaskTimeout              time.Duration         // How long before a running task with no heartbeat is considered stale (default: 5m)
	LogRetention             time.Duration         // How long to keep task logs before deleting them (0 = keep forever)
	Models                   []setting.ModelOption // Available Claude models; if empty, uses DefaultModels
}

Config holds the API server configuration.

func (Config) EffectiveModels

func (c Config) EffectiveModels() []setting.ModelOption

EffectiveModels returns the configured models or the default set.

type PostgresConfig

type PostgresConfig struct {
	User     string
	Password string
	HostPort string
	Database string
}

PostgresConfig holds PostgreSQL connection parameters.

func (PostgresConfig) IsSet

func (c PostgresConfig) IsSet() bool

IsSet returns true if Postgres connection parameters are configured.

Jump to

Keyboard shortcuts

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