server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 15 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 wires the vx server together: database, blob store, git bridge, API handlers and the HTTP listener.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addr        string // listen address, e.g. ":7070"
	DatabaseURL string
	DataDir     string // blob store and git mirrors live here
	Logger      *slog.Logger
	// Upstream imports branches from git providers; nil disables it.
	Upstream func(st *store.Store, blobs blob.Store, dataDir string) (service.UpstreamSyncer, error)
}

Config is the server configuration.

type Server

type Server struct {
	Store   *store.Store
	Blobs   blob.Store
	Service *service.Service
	Handler http.Handler
	// contains filtered or unexported fields
}

Server is a running vx server.

func New

func New(ctx context.Context, cfg Config) (*Server, error)

New opens the database (applying migrations) and builds the handler.

func (*Server) Close

func (s *Server) Close()

Close releases the database.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(ctx context.Context, addr string) error

ListenAndServe serves until ctx is cancelled, then shuts down gracefully.

Jump to

Keyboard shortcuts

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