wikiserver

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

@index HTTP handlers for the ccg-server Wiki UI and its viewer-oriented JSON API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	StaticDir     string
	RagIndexDir   string
	NamespaceRoot string
	Repository    wiki.Repository
	Retrieval     *retrieval.Service
	Logger        *slog.Logger
}

Config describes the external Wiki asset directory and data roots. @intent keep Wiki UI serving outside the ccg binary while letting ccg-server expose docs/RAG data.

type Server

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

Server serves static Wiki assets and small JSON APIs for docs exploration. @intent isolate browser-facing Wiki behavior from MCP transport and webhook handlers.

func New

func New(cfg Config) (*Server, error)

New validates the Wiki static directory and creates a server instance. @intent fail server startup early when --wiki-dir points at an unusable dist directory.

func (*Server) APIHandler

func (s *Server) APIHandler() http.Handler

APIHandler routes Wiki JSON API requests. @intent provide browser-friendly access to namespaces, Wiki trees, docs, search, and copied context.

func (*Server) StaticHandler

func (s *Server) StaticHandler() http.Handler

StaticHandler serves the React dist directory with SPA fallback to index.html. @intent let ccg-server expose the Wiki UI without embedding frontend assets into the binary. @sideEffect reads static files from --wiki-dir.

Jump to

Keyboard shortcuts

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