http

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 22 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:

  • Environments: /environments, /environments/{id}
  • 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
  • Content entries: /content, /content/{id}
  • Menus: /menus, /menus/{id}
  • Block library: /blocks, /blocks/{id}
  • Promotions: /environments/{source}/promote/{target}, /content-types/{id}/promote, /content/{id}/promote

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, blocks, and environment-aware operations.

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 WithContentService added in v0.23.1

func WithContentService(service content.Service) AdminOption

WithContentService wires the content entry service.

func WithContentTypeService

func WithContentTypeService(service content.ContentTypeService) AdminOption

WithContentTypeService wires the content type service.

func WithEnvironmentConfig added in v0.23.1

func WithEnvironmentConfig(cfg runtimeconfig.EnvironmentsConfig) AdminOption

WithEnvironmentConfig wires environment defaults and requirements for the admin API.

func WithEnvironmentService added in v0.23.1

func WithEnvironmentService(service cmsenv.Service) AdminOption

WithEnvironmentService wires the environment service.

func WithMenuService added in v0.23.1

func WithMenuService(service menus.Service) AdminOption

WithMenuService wires the menu service.

func WithOverlayResolver

func WithOverlayResolver(resolver schema.OverlayResolver) AdminOption

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

func WithPromotionService added in v0.23.1

func WithPromotionService(service promotions.Service) AdminOption

WithPromotionService wires the promotion orchestration service.

Jump to

Keyboard shortcuts

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