handlers

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: Apache-2.0 Imports: 27 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetadataHandler added in v0.2.0

type MetadataHandler struct{}

func NewMetadataHandler

func NewMetadataHandler() *MetadataHandler

func (MetadataHandler) Get added in v0.2.0

Get sends API documentation response.

type OpenAPIHandler added in v0.2.0

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

func NewOpenAPIHandler

func NewOpenAPIHandler() (*OpenAPIHandler, error)

func (*OpenAPIHandler) GetOpenAPI added in v0.2.0

func (h *OpenAPIHandler) GetOpenAPI(w http.ResponseWriter, r *http.Request)

func (*OpenAPIHandler) GetOpenAPIUI added in v0.2.0

func (h *OpenAPIHandler) GetOpenAPIUI(w http.ResponseWriter, r *http.Request)

type PrometheusMetricsHandler added in v0.2.0

type PrometheusMetricsHandler struct {
}

func NewPrometheusMetricsHandler

func NewPrometheusMetricsHandler() *PrometheusMetricsHandler

func (*PrometheusMetricsHandler) Handler added in v0.2.0

func (h *PrometheusMetricsHandler) Handler() http.Handler

type ResourceHandler added in v0.3.0

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

ResourceHandler serves both flat and owner-nested routes for a single entity kind. Every method branches on whether "parent_id" is present via r.PathValue("parent_id") rather than dispatching statically per route. This is only correct because cmd/hyperfleet-api/server/routes_entities.go guarantees the invariant: a nested (ParentKind != "") descriptor is registered exclusively under a {parent_id} subrouter, and a flat descriptor never is. If that registration is ever bypassed — e.g. a nested kind wired to a flat route — these branches take the wrong path silently (Create would skip setting owner references instead of erroring).

func NewResourceHandler added in v0.3.0

func NewResourceHandler(
	descriptor registry.EntityDescriptor,
	service services.ResourceService,
) *ResourceHandler

func (*ResourceHandler) Create added in v0.3.0

func (h *ResourceHandler) Create(w http.ResponseWriter, r *http.Request)

func (*ResourceHandler) Delete added in v0.3.0

func (h *ResourceHandler) Delete(w http.ResponseWriter, r *http.Request)

func (*ResourceHandler) ForceDelete added in v0.3.1

func (h *ResourceHandler) ForceDelete(w http.ResponseWriter, r *http.Request)

func (*ResourceHandler) Get added in v0.3.0

func (*ResourceHandler) List added in v0.3.0

func (*ResourceHandler) Patch added in v0.3.0

type ResourceStatusHandler added in v0.3.1

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

ResourceStatusHandler handles GET/PUT on /{plural}/{id}/statuses for config-driven generic resources. Each method branches on whether "parent_id" is present via r.PathValue("parent_id") to handle both flat and nested routes — matching the pattern established by ResourceHandler in HYPERFLEET-1157.

func NewResourceStatusHandler added in v0.3.1

func NewResourceStatusHandler(
	descriptor registry.EntityDescriptor,
	resourceService services.ResourceService,
	adapterStatusService services.AdapterStatusService,
) *ResourceStatusHandler

func (*ResourceStatusHandler) Create added in v0.3.1

Create creates or updates an adapter status for a resource. Verifies ownership when parent_id is present in the route.

func (*ResourceStatusHandler) List added in v0.3.1

List returns all adapter statuses for a resource with pagination. Verifies ownership when parent_id is present in the route.

type RestHandler

type RestHandler interface {
	List(w http.ResponseWriter, r *http.Request)
	Get(w http.ResponseWriter, r *http.Request)
	Create(w http.ResponseWriter, r *http.Request)
	Patch(w http.ResponseWriter, r *http.Request)
}

type RootResourceHandler added in v0.3.1

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

func NewRootResourceHandler added in v0.3.1

func NewRootResourceHandler(
	service services.ResourceService,
	adapterStatusService services.AdapterStatusService,
	validator *validators.SchemaValidator,
) *RootResourceHandler

func (*RootResourceHandler) Create added in v0.3.1

func (*RootResourceHandler) CreateStatus added in v0.3.1

func (h *RootResourceHandler) CreateStatus(w http.ResponseWriter, r *http.Request)

CreateStatus creates or updates an adapter status for a resource resolved by ID.

func (*RootResourceHandler) Delete added in v0.3.1

func (*RootResourceHandler) ForceDelete added in v0.3.1

func (h *RootResourceHandler) ForceDelete(w http.ResponseWriter, r *http.Request)

func (*RootResourceHandler) Get added in v0.3.1

func (*RootResourceHandler) List added in v0.3.1

func (*RootResourceHandler) ListStatuses added in v0.3.1

func (h *RootResourceHandler) ListStatuses(w http.ResponseWriter, r *http.Request)

ListStatuses returns adapter statuses for a resource resolved by ID.

func (*RootResourceHandler) Patch added in v0.3.1

Jump to

Keyboard shortcuts

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