public_api

package
v0.1.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: Apache-2.0 Imports: 6 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 Config

type Config struct {
	URI string `json:"uri,omitempty"`
}

type Plugin

type Plugin struct {
	base.BasePlugin
	// contains filtered or unexported fields
}

func (*Plugin) Config

func (p *Plugin) Config() any

func (*Plugin) Handler

func (p *Plugin) Handler(next http.Handler) http.Handler

func (*Plugin) Init

func (p *Plugin) Init() error

func (*Plugin) PostInit

func (p *Plugin) PostInit() error

func (*Plugin) RunRequestPhase

func (p *Plugin) RunRequestPhase(w http.ResponseWriter, r *http.Request) base.RequestPhaseResult

RunRequestPhase owns the local public-api gateway response. The gateway is an APISIX response even when a registered handler produces the body.

func (*Plugin) SetPublicAPIRegistry

func (p *Plugin) SetPublicAPIRegistry(registry *Registry)

SetPublicAPIRegistry injects the registry owned by the route generation before PostInit registers any public endpoint.

type Registry

type Registry struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Registry owns the public APIs for one route generation. A registry must be captured by every public-api handler in that generation so route rebuilds cannot change an already-published handler's dispatch table.

func NewRegistry

func NewRegistry() *Registry

func (*Registry) Checkpoint

func (r *Registry) Checkpoint() RegistryCheckpoint

Checkpoint returns a consistent snapshot of the registry's handlers and owner claims. Handler values are immutable references; only the maps are copied so a rollback cannot retain later registrations.

func (*Registry) ClaimOwner

func (r *Registry) ClaimOwner(owner string, identity string) error

ClaimOwner rejects conflicting registrations from instances that own the same generation-level public APIs. Repeating an identical identity is safe.

func (*Registry) Lookup

func (r *Registry) Lookup(method string, uri string) http.Handler

func (*Registry) Register

func (r *Registry) Register(method string, uri string, handler http.Handler)

func (*Registry) Rollback

func (r *Registry) Rollback(checkpoint RegistryCheckpoint)

Rollback restores a previously captured registry checkpoint.

type RegistryCheckpoint

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

RegistryCheckpoint captures a registry generation's mutable public API state so a route build can be rolled back without affecting other routes.

Jump to

Keyboard shortcuts

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