rest

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package rest exposes memini's HTTP/JSON API. It is a thin adapter over the service layer; the MCP surface (internal/api/mcp) shares the same service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	// APIKey, when non-empty, is required as "Authorization: Bearer <key>".
	APIKey string
	// NamespaceHeader names the request header carrying the tenant namespace.
	NamespaceHeader string
	// DefaultNamespace is used when the header is absent.
	DefaultNamespace string
}

AuthConfig configures the optional bearer-token auth and namespace resolution.

type Handler

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

Handler serves the REST API backed by a service.Service.

func New

func New(svc *service.Service, auth AuthConfig) *Handler

New builds a REST handler.

func (*Handler) Mount

func (h *Handler) Mount(r chi.Router)

Mount attaches the /v1 routes to r, wrapped in namespace + auth middleware.

Jump to

Keyboard shortcuts

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