Documentation
¶
Overview ¶
Package adminapp is the public embed facade for tokenlive-admin. External hosts (tokenlive-standalone) can Init + Register onto a shared Gin engine without starting the CLI server or calling os.Exit.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is an initialized admin runtime (DB, mods, optional HTTP).
func (*App) LoadGatewaySnapshot ¶
func (a *App) LoadGatewaySnapshot(ctx context.Context) (*GatewaySnapshot, error)
LoadGatewaySnapshot loads routing config, policies, and API keys from the admin DB (same data as Gateway Sync HTTP APIs, without network or sync token).
type GatewaySnapshot ¶
GatewaySnapshot is JSON-encoded admin gateway export (same shape as /api/v1/gateway/*). Hosts unmarshal into tokenlive-gateway config types without importing admin internal packages.
type Options ¶
type Options struct {
WorkDir string // default "configs"
Configs string // relative to WorkDir, default "dev"
StaticDir string // SPA directory; empty skips static middleware
// Engine, if non-nil, is used for Register (host-owned). New does not listen.
Engine *gin.Engine
// When Engine is set, these defaults avoid clobbering host routes.
// DisableHealth defaults true if Engine != nil.
// DisableNoRoute defaults true if Engine != nil.
DisableHealth *bool
DisableNoRoute *bool
DisableSwagger bool
DisableStatic bool
// OnConfigChanged is invoked after admin mutations that affect gateway runtime.
// kind: endpoints | policies | apikeys | all
OnConfigChanged util.ConfigChangeListener
}
Options configures admin embed startup.