server

command
v0.0.0-...-7e01366 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Code generated by Fabrica v0.3.1-35-gaf1d3ba-dirty. DO NOT EDIT. Copyright © 2025 OpenCHAMI a Series of LF Projects, LLC

SPDX-License-Identifier: MIT

This file contains request/response models for REST API operations. Generated from: pkg/codegen/templates/models.go.tmpl

To modify request/response models:

  1. Edit the template file: pkg/codegen/templates/models.go.tmpl
  2. Run 'make dev' to regenerate
  3. Do NOT edit this file directly - changes will be lost

Generated models for each resource:

  • ResourceResponse: Single resource response (alias to resource type)
  • ResourcesResponse: List of resources with pagination info
  • CreateResourceRequest: Create operation request body
  • UpdateResourceRequest: Update operation request body
  • DeleteResponse: Delete operation response

Request structure:

  • Embeds resource Spec fields inline (json:",inline")
  • Includes metadata fields (Name, Labels, Annotations)
  • Uses validation tags for required fields

To add custom validation:

  1. Add validation tags to template (e.g., validate:"required,email")
  2. Implement validation middleware in handlers

To add additional fields:

  1. Modify Create/Update request structs in template
  2. Update corresponding handlers to process new fields

Code generated by codegen. DO NOT EDIT. Copyright © 2025 OpenCHAMI a Series of LF Projects, LLC

SPDX-License-Identifier: MIT

This file contains OpenAPI 3.0 specification generation for all resources. Generated from: pkg/codegen/templates/openapi.go.tmpl

To modify OpenAPI spec:

  1. Edit the template file: pkg/codegen/templates/openapi.go.tmpl
  2. Run 'make dev' to regenerate
  3. Do NOT edit this file directly - changes will be lost

OpenAPI endpoints:

  • GET /openapi.json - Returns OpenAPI 3.0 spec
  • GET /docs - Returns Swagger UI

This file automatically generates OpenAPI schemas from Go types using kin-openapi's openapi3gen package. No docstring annotations required.

Code generated by Fabrica v0.3.1-35-gaf1d3ba-dirty. DO NOT EDIT. Template: server/handlers.go.tmpl Generated: 2026-01-07T16:01:04-08:00

SPDX-License-Identifier: MIT

This file contains REST API handlers for PowerStatusComponent resources.

To modify this code:

  1. Edit the template file: pkg/codegen/templates/handlers.go.tmpl
  2. Run 'make dev' to regenerate
  3. Do NOT edit this file directly - changes will be lost

Generated handlers provide:

  • GET /powerstatuscomponents (list all powerstatuscomponents)
  • GET /powerstatuscomponents/{uid} (get specific PowerStatusComponent)
  • POST /powerstatuscomponents (create new PowerStatusComponent)
  • PUT /powerstatuscomponents/{uid} (update PowerStatusComponent spec)
  • PATCH /powerstatuscomponents/{uid} (patch PowerStatusComponent spec)
  • DELETE /powerstatuscomponents/{uid} (delete PowerStatusComponent)
  • PUT /powerstatuscomponents/{uid}/status (update PowerStatusComponent status)
  • PATCH /powerstatuscomponents/{uid}/status (patch PowerStatusComponent status)

Authorization: Add custom middleware for authentication/authorization Storage: Uses storage.LoadPowerStatusComponent*/SavePowerStatusComponent*/DeletePowerStatusComponent* Version Support: Available (see version context in handlers)

To enable full version conversion for this resource:

  1. Create v2beta1 package: pkg/resources/powerstatuscomponent/v2beta1/
  2. Implement converter: v2beta1/converter.go
  3. Add version-aware storage: storage.LoadPowerStatusComponentWithVersion()
  4. Register versions in cmd/server/main.go

Code generated by codegen. DO NOT EDIT. Copyright © 2025 OpenCHAMI a Series of LF Projects, LLC

SPDX-License-Identifier: MIT

This file contains REST API route registrations for all resources. Generated from: pkg/codegen/templates/routes.go.tmpl

To modify route registration:

  1. Edit the template file: pkg/codegen/templates/routes.go.tmpl
  2. Run 'make dev' to regenerate
  3. Do NOT edit this file directly - changes will be lost

This file registers routes for all resource types:

  • /powerstatuscomponents (PowerStatusComponent operations)
  • /transitions (Transition operations)

Route patterns:

  • GET /resource -> List all resources
  • GET /resource/{uid} -> Get specific resource
  • POST /resource -> Create new resource
  • PUT /resource/{uid} -> Update resource spec
  • PATCH /resource/{uid} -> Patch resource spec
  • DELETE /resource/{uid} -> Delete resource
  • PUT /resource/{uid}/status -> Update resource status
  • PATCH /resource/{uid}/status -> Patch resource status

To add middleware to routes:

  1. Apply middleware in cmd/server/main.go before calling RegisterGeneratedRoutes
  2. Use r.Use() calls in main.go, not in generated route functions

To add custom routes:

  1. Create a separate RegisterCustomRoutes function
  2. Call it after RegisterGeneratedRoutes in main.go

Code generated by Fabrica v0.3.1-35-gaf1d3ba-dirty. DO NOT EDIT. Template: server/handlers.go.tmpl Generated: 2026-01-07T16:01:04-08:00

SPDX-License-Identifier: MIT

This file contains REST API handlers for Transition resources.

To modify this code:

  1. Edit the template file: pkg/codegen/templates/handlers.go.tmpl
  2. Run 'make dev' to regenerate
  3. Do NOT edit this file directly - changes will be lost

Generated handlers provide:

  • GET /transitions (list all transitions)
  • GET /transitions/{uid} (get specific Transition)
  • POST /transitions (create new Transition)
  • PUT /transitions/{uid} (update Transition spec)
  • PATCH /transitions/{uid} (patch Transition spec)
  • DELETE /transitions/{uid} (delete Transition)
  • PUT /transitions/{uid}/status (update Transition status)
  • PATCH /transitions/{uid}/status (patch Transition status)

Authorization: Add custom middleware for authentication/authorization Storage: Uses storage.LoadTransition*/SaveTransition*/DeleteTransition* Version Support: Available (see version context in handlers)

To enable full version conversion for this resource:

  1. Create v2beta1 package: pkg/resources/transition/v2beta1/
  2. Implement converter: v2beta1/converter.go
  3. Add version-aware storage: storage.LoadTransitionWithVersion()
  4. Register versions in cmd/server/main.go

Jump to

Keyboard shortcuts

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