api

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

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 wraps a BrainGraph and serves the REST API and frontend.

func NewServer

func NewServer(g *graph.BrainGraph, opts ServerOptions) *Server

NewServer creates a new API server with the given graph.

func (*Server) Start

func (s *Server) Start(addr string) error

Start listens and serves HTTP on the given address.

type ServerOptions

type ServerOptions struct {
	// AllowOrigin, when non-empty, is sent as the Access-Control-Allow-Origin
	// header on /api responses. Empty disables CORS entirely — appropriate
	// for the default localhost-only bind.
	AllowOrigin string
}

ServerOptions configures optional behavior of the API server.

Jump to

Keyboard shortcuts

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