Help us shape the future of Go! Take the 2026 Go Developer Survey

api

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(opts Options) http.Handler

func NewRouterWithAPI

func NewRouterWithAPI(opts Options) (http.Handler, *handler.Handler)

Types

type Options

type Options struct {
	Config     *config.Config
	ConfigPath string
	Store      storage.Store
	// SessionValidator is the session lifetime bound to this router. Production
	// composition supplies the same durable management store used by approval
	// and migration; embedded/test callers retain Store as the compatibility
	// default.
	SessionValidator                    middleware.SessionValidator
	Sink                                storage.LogSink
	Hub                                 *realtime.Hub
	Secret                              string
	SetupToken                          string
	SetupTokenSource                    setup.TokenSource
	OnSitesChanged                      func([]config.SiteConfig) error
	OnEdgeChanged                       func(config.EdgeConfig) error
	OnProtectionChanged                 func(config.ProtectionConfig) error
	OnCAPTCHAProvidersChanged           func(config.CAPTCHAProvidersConfig) error
	ProtectionPolicyCoordinator         handler.ProtectionPolicyCoordinatorConsumer
	RequireProtectionPolicyCoordinator  bool
	OnAPISecChanged                     func(config.APISecConfig) error
	OnBlockPageChanged                  func(config.BlockPageConfig) error
	OnTimeSyncChanged                   func(config.TimeSyncConfig) error
	OnConfigChanged                     func(*config.Config) error
	ACMEIssuer                          acme.Issuer
	AuthState                           *handler.AuthState
	AssistantApprovals                  *ai.ApprovalStore
	ClusterIdentity                     *identity.MemoryIdentityService
	ClusterHeartbeats                   *cluster.HeartbeatRegistry
	CAPTCHAAssets                       captchaassets.Store
	Clock                               timekeeper.Clock
	TimeSync                            handler.TimeSyncService
	OTAClient                           handler.OTAClient
	OTAState                            handler.OTAStateReader
	TemporaryHTTPExecutor               netlease.TemporaryHTTPExecutor
	CWEDPDownload                       consumer.Executor
	CRPActivation                       handler.CRPActivationExecutor
	ManagementTokenConfirmationVerifier handler.ManagementTokenConfirmationVerifier
	// AssistantGateApproval is the same durable high-risk boundary used by AI
	// destructive tools. The composition root must provide it in production.
	AssistantGateApproval *ai.GateApprovalAdapter
	// ApprovalHTTP is an optional, fully configured high-risk ApprovalGate
	// transport. It is mounted only inside the authenticated management API
	// group; leaving it nil keeps the route absent rather than exposing an
	// incomplete approval implementation.
	ApprovalHTTP *handler.ApprovalHTTPHandler
	// ManagementTokenCleanupContext enables the service-owned, single cleanup
	// worker. Leave nil for embedded/test routers that manage cleanup explicitly.
	ManagementTokenCleanupContext context.Context
	// IsolateConfig makes the router own a deep-cloned configuration graph.
	// The serve command enables it so background readers never alias API writes.
	IsolateConfig bool
}

Directories

Path Synopsis
Package dto provides dto functionality for CheeseWAF.
Package dto provides dto functionality for CheeseWAF.
Package handler provides handler functionality for CheeseWAF.
Package handler provides handler functionality for CheeseWAF.
Package middleware provides middleware functionality for CheeseWAF.
Package middleware provides middleware functionality for CheeseWAF.

Jump to

Keyboard shortcuts

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