server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT 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 is KairoCode's HTTP API (design 8.1): sessions, messages, turns, approvals, undo and redo, and a session's events (SSE). The daemon serves it (ADR 0008).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorCode

func ErrorCode(err error) string

ErrorCode is err's code on the wire ("" for an error a client does not tell apart).

func ErrorOf

func ErrorOf(code string) error

ErrorOf is the error a code stands for (nil for none known).

func Fail

func Fail(w http.ResponseWriter, code int, err error)

Fail writes err as the API's error response: the daemon's client is checked against it (TestErrorsCrossTheSocket).

Types

type Server

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

func New

func New(rt *runtime.Runtime, token string, newID func() string) *Server

func (*Server) Authorized

func (s *Server) Authorized(h http.HandlerFunc) http.Handler

Authorized serves h only to requests that carry the token.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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