handlers

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: EPL-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Stable v3 error code taxonomy.
	ErrCodeInvalidArgument  = "INVALID_ARGUMENT"
	ErrCodeUnauthorized     = "UNAUTHORIZED"
	ErrCodeForbidden        = "FORBIDDEN"
	ErrCodeNotFound         = "NOT_FOUND"
	ErrCodeConflict         = "CONFLICT"
	ErrCodeApplyInProgress  = "APPLY_IN_PROGRESS"
	ErrCodeNotImplemented   = "NOT_IMPLEMENTED"
	ErrCodeInternal         = "INTERNAL"
	ErrCodeMethodNotAllowed = "METHOD_NOT_ALLOWED"
	ErrCodeExecStartTimeout = "EXEC_START_TIMEOUT"
)
View Source
const (
	EdgeletAPIStartupInitializing = "initializing"
	EdgeletAPIStartupListening    = "listening"
	EdgeletAPIStartupFailed       = "failed"
)

Variables

This section is empty.

Functions

func HealthLiveHandler

func HealthLiveHandler(w http.ResponseWriter, _ *http.Request)

HealthLiveHandler handles /health/live — liveness probe. Returns 200 if the process is running and the HTTP server can respond. Used by orchestrators (Kubernetes, systemd) to determine if the process should be restarted.

func HealthReadyHandler

func HealthReadyHandler(w http.ResponseWriter, _ *http.Request)

HealthReadyHandler handles /health/ready — readiness probe. Returns 200 when the local API is listening and the supervisor has finished engine wiring. Controller connectivity is reported separately in status; it does not gate local readiness.

func MetricsHandler

func MetricsHandler(w http.ResponseWriter, _ *http.Request)

MetricsHandler handles /metrics — Prometheus-format metrics. Exposes basic agent metrics for enterprise observability.

func MetricsStartTime

func MetricsStartTime() time.Time

MetricsStartTime returns agent start time for metrics.

func NotImplemented

func NotImplemented(w http.ResponseWriter, _ *http.Request)

NotImplemented returns a generic 501 response for staged endpoints.

func SetEdgeletAPIStartupState

func SetEdgeletAPIStartupState(phase, reason string)

SetEdgeletAPIStartupState updates the listener startup phase for health checks.

Types

type AuthHandler

type AuthHandler struct{}

AuthHandler handles auth-related EdgeletAPI requests.

func NewAuthHandler

func NewAuthHandler() *AuthHandler

NewAuthHandler creates a new auth handler.

func (*AuthHandler) HandleWhoAmI

func (h *AuthHandler) HandleWhoAmI(w http.ResponseWriter, r *http.Request)

HandleWhoAmI handles GET /v1/auth/whoami.

type AuthWhoAmIResponse

type AuthWhoAmIResponse struct {
	Subject   string         `json:"subject"`
	TokenType string         `json:"tokenType"`
	Issuer    string         `json:"issuer"`
	Audience  []string       `json:"audience"`
	JTI       string         `json:"jti,omitempty"`
	ExpiresAt int64          `json:"expiresAt,omitempty"`
	Claims    map[string]any `json:"claims"`
}

AuthWhoAmIResponse returns caller identity details.

type EdgeletAPIHandler

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

EdgeletAPIHandler handles Edgelet API v1 endpoint groups.

func NewEdgeletAPIHandler

func NewEdgeletAPIHandler() *EdgeletAPIHandler

NewEdgeletAPIHandler creates a new Edgelet API handler.

func (*EdgeletAPIHandler) HandleAuthTokens

func (h *EdgeletAPIHandler) HandleAuthTokens(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleAuthTokensRevoke

func (h *EdgeletAPIHandler) HandleAuthTokensRevoke(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleConfig

func (h *EdgeletAPIHandler) HandleConfig(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleDeployControlPlaneApply

func (h *EdgeletAPIHandler) HandleDeployControlPlaneApply(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleDeployControlPlaneApplyStatus

func (h *EdgeletAPIHandler) HandleDeployControlPlaneApplyStatus(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleDeployControlPlaneValidate

func (h *EdgeletAPIHandler) HandleDeployControlPlaneValidate(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleDeployMicroservices

func (h *EdgeletAPIHandler) HandleDeployMicroservices(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleDeployMicroservicesApply

func (h *EdgeletAPIHandler) HandleDeployMicroservicesApply(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleDeployMicroservicesApplyStatus

func (h *EdgeletAPIHandler) HandleDeployMicroservicesApplyStatus(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleDeployMicroservicesValidate

func (h *EdgeletAPIHandler) HandleDeployMicroservicesValidate(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleDeployRegistries

func (h *EdgeletAPIHandler) HandleDeployRegistries(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleDeployRegistriesApply

func (h *EdgeletAPIHandler) HandleDeployRegistriesApply(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleDeployRegistriesValidate

func (h *EdgeletAPIHandler) HandleDeployRegistriesValidate(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleDeployRuntimeClasses

func (h *EdgeletAPIHandler) HandleDeployRuntimeClasses(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleDeployRuntimeClassesApply

func (h *EdgeletAPIHandler) HandleDeployRuntimeClassesApply(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleDeployRuntimeClassesApplyStatus

func (h *EdgeletAPIHandler) HandleDeployRuntimeClassesApplyStatus(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleDeployRuntimeClassesDeleteStatus

func (h *EdgeletAPIHandler) HandleDeployRuntimeClassesDeleteStatus(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleDeployRuntimeClassesValidate

func (h *EdgeletAPIHandler) HandleDeployRuntimeClassesValidate(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleImageLoad

func (h *EdgeletAPIHandler) HandleImageLoad(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleImageLoadStatus

func (h *EdgeletAPIHandler) HandleImageLoadStatus(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleImagePrune

func (h *EdgeletAPIHandler) HandleImagePrune(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleImagePull

func (h *EdgeletAPIHandler) HandleImagePull(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleImagePullStatus

func (h *EdgeletAPIHandler) HandleImagePullStatus(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleImageRemove

func (h *EdgeletAPIHandler) HandleImageRemove(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleImages

func (h *EdgeletAPIHandler) HandleImages(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleMicroserviceConfigSelf

func (h *EdgeletAPIHandler) HandleMicroserviceConfigSelf(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleMicroservices

func (h *EdgeletAPIHandler) HandleMicroservices(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleRuntimeDrain added in v1.0.1

func (h *EdgeletAPIHandler) HandleRuntimeDrain(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleSystemConfigSwitch

func (h *EdgeletAPIHandler) HandleSystemConfigSwitch(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleSystemControlPlane

func (h *EdgeletAPIHandler) HandleSystemControlPlane(w http.ResponseWriter, r *http.Request)

HandleSystemControlPlane routes GET/DELETE /v1/system/controlplane and GET manifest.

func (*EdgeletAPIHandler) HandleSystemControlPlaneRestart

func (h *EdgeletAPIHandler) HandleSystemControlPlaneRestart(w http.ResponseWriter, r *http.Request)

HandleSystemControlPlaneRestart handles POST /v1/system/controlplane/restart.

func (*EdgeletAPIHandler) HandleSystemControllerCert

func (h *EdgeletAPIHandler) HandleSystemControllerCert(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleSystemControllerStatus

func (h *EdgeletAPIHandler) HandleSystemControllerStatus(w http.ResponseWriter, r *http.Request)

HandleSystemControllerStatus is the GET /v1/system/controller status alias.

func (*EdgeletAPIHandler) HandleSystemGPS

func (h *EdgeletAPIHandler) HandleSystemGPS(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleSystemLogs

func (h *EdgeletAPIHandler) HandleSystemLogs(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleSystemProvision

func (h *EdgeletAPIHandler) HandleSystemProvision(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleSystemPrune

func (h *EdgeletAPIHandler) HandleSystemPrune(w http.ResponseWriter, r *http.Request)

func (*EdgeletAPIHandler) HandleSystemReload

func (h *EdgeletAPIHandler) HandleSystemReload(w http.ResponseWriter, r *http.Request)

type InfoHandler

type InfoHandler struct {
}

InfoHandler handles info API requests

func (*InfoHandler) HandleInfo

func (h *InfoHandler) HandleInfo(w http.ResponseWriter, r *http.Request)

HandleInfo handles GET /v1/system/info

type StatusHandler

type StatusHandler struct {
}

StatusHandler handles status API requests

func (*StatusHandler) HandleStatus

func (h *StatusHandler) HandleStatus(w http.ResponseWriter, r *http.Request)

HandleStatus handles GET /v1/system/status

type VersionHandler

type VersionHandler struct {
}

VersionHandler handles version API requests

func (*VersionHandler) HandleVersion

func (h *VersionHandler) HandleVersion(w http.ResponseWriter, r *http.Request)

HandleVersion handles GET /v1/system/version.

Jump to

Keyboard shortcuts

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