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 ¶
- type AdminAPI
- type AdminOption
- func WithBasePath(path string) AdminOption
- func WithBlockService(service blocks.Service) AdminOption
- func WithContentService(service content.Service) AdminOption
- func WithContentTypeService(service content.ContentTypeService) AdminOption
- func WithEnvironmentConfig(cfg runtimeconfig.EnvironmentsConfig) AdminOption
- func WithEnvironmentService(service cmsenv.Service) AdminOption
- func WithMenuService(service menus.Service) AdminOption
- func WithOverlayResolver(resolver schema.OverlayResolver) AdminOption
- func WithPromotionService(service promotions.Service) AdminOption
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.
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.