api

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package api provides the HTTP server for the stackit-web application.

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 is the stackit-web HTTP server. Per-repo state (engine, watcher, broadcaster) lives on each registry entry — the server only owns transport-level concerns.

func NewServer

func NewServer(cfg ServerConfig) *Server

NewServer creates a new API server backed by the given registry.

func (*Server) Shutdown

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

Shutdown gracefully stops the server. The registry's watchers and broadcasters are torn down separately by main.go's defer reg.Close().

func (*Server) Start

func (s *Server) Start() error

Start begins serving HTTP requests. It blocks until the server is stopped.

type ServerConfig

type ServerConfig struct {
	Port        int
	CORSOrigins []string
	APIPrefixes []string
	StaticFS    fs.FS
	Registry    *registry.Registry
}

ServerConfig holds configuration for the API server.

Directories

Path Synopsis
Package registry holds the set of repositories served by the stackit server, keyed by a stable repoID.
Package registry holds the set of repositories served by the stackit server, keyed by a stable repoID.
Package watcher provides file system monitoring for git ref changes.
Package watcher provides file system monitoring for git ref changes.

Jump to

Keyboard shortcuts

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