router

package
v0.0.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(r *gin.Engine, svcs Services, authMiddleware gin.HandlerFunc)

Setup registers all routes on the provided gin.Engine. authMiddleware is the authenticate middleware; it also enforces admin access for routes that have AdminKeyAuth security (via oapi-codegen per-route c.Set).

Types

type Services

type Services struct {
	Sandbox         service.SandboxService
	SandboxEnv      service.SandboxEnvService
	SandboxTemplate service.SandboxTemplateService
	APIKey          service.APIKeyService
	Quota           service.QuotaService
	Organization    service.OrganizationService
	IAM             service.IAMService
	// KubeClientset and RestConfig are needed for the WebSocket terminal handler and log streaming.
	KubeClientset kubernetes.Interface
	RestConfig    *rest.Config
	// Sync and SyncToken enable the /v1/ws/sync endpoint for ws-proxy connections.
	// When SyncToken is empty the endpoint is disabled.
	Sync      service.SyncService
	SyncToken string
	// Forwarder enables cross-cluster forwarding at the handler layer.
	// localClusterID is embedded in the forwarder itself; no separate field needed.
	// When Forwarder is nil, cross-cluster requests are rejected.
	Forwarder *service.CrossClusterForwarder
	// Cluster serves the /v1/clusters discovery endpoint. Must always be non-nil
	// (single-cluster deployments can inject a service with nil store + empty
	// localID; the endpoint then returns an empty catalog).
	Cluster service.ClusterService
	// QuotaProvider drives the /v1/feature-gates endpoint.
	// Nil is accepted and treated as Noop downstream.
	QuotaProvider quotaplugin.Provider
	// InstanceTypeProvider drives the /v1/instancetypes endpoint and the
	// matching `instanceType` flag on /v1/feature-gates. Nil is accepted and
	// treated as Noop downstream.
	InstanceTypeProvider instancetypeplugin.Provider
	// ServerVersion is stamped onto every response via X-AgentBox-Server-Version.
	// Comes from pkg/version.Version (injected at build time via -ldflags).
	ServerVersion string
}

Services bundles all service interfaces needed by the router.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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