http

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package http provides optional HTTP adapters for CMS admin APIs.

Routes follow the Content Type Builder design spec and mount under /admin/api:

  • Content types: /content-types, /content-types/{id}, /content-types/{id}/publish, /content-types/{id}/clone
  • Schema utilities: /content-types/validate, /content-types/preview, /content-types/{id}/schema, /content-types/{id}/openapi
  • Block library: /blocks, /blocks/{id}

Host applications can register handlers on their own mux/router as needed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminAPI

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

AdminAPI registers admin endpoints for content types and blocks.

func NewAdminAPI

func NewAdminAPI(opts ...AdminOption) *AdminAPI

NewAdminAPI constructs an AdminAPI instance.

func (*AdminAPI) Register

func (api *AdminAPI) Register(mux *http.ServeMux) error

Register attaches the admin endpoints to the provided mux.

type AdminOption

type AdminOption func(*AdminAPI)

AdminOption mutates the AdminAPI configuration.

func WithBasePath

func WithBasePath(path string) AdminOption

WithBasePath overrides the base API path (defaults to "/admin/api").

func WithBlockService

func WithBlockService(service blocks.Service) AdminOption

WithBlockService wires the block service.

func WithContentTypeService

func WithContentTypeService(service content.ContentTypeService) AdminOption

WithContentTypeService wires the content type service.

func WithOverlayResolver

func WithOverlayResolver(resolver schema.OverlayResolver) AdminOption

WithOverlayResolver sets the overlay resolver used by schema preview/export utilities.

Jump to

Keyboard shortcuts

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