Documentation
¶
Overview ¶
Package visor exposes visor's in-process bootstrap so a parent binary (github.com/hanzoai/cloud) can mount visor's /v1 Beego surface in the same address space — the same routers, controllers and filters the standalone server runs, minus the listener.
There is ONE boot path. Both cmd main() and the embedded cloud mount call Bootstrap; the only difference is who owns the listener (main.go calls beego.Run; the cloud mount serves Handler() behind its own zip.App).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bootstrap ¶
func Bootstrap()
Bootstrap runs visor's full in-process initialization — DB adapter, authz, IP/UA parsers, HTTP filters, session config and background tickers — exactly as the standalone server does, MINUS binding a listener. It is the single boot path shared by cmd main() and the embedded cloud mount, so the two can never drift.
func Handler ¶
Handler boots visor in-process and returns its Beego HTTP handler for a parent binary to mount behind its own listener. It runs Bootstrap, then initializes the Beego session manager — normally created inside beego.Run's registerSession hook, which the embed path skips — and returns the wired handler.
Beego's BeeApp is a process singleton, so Handler must be called at most once per process. Any panic from the underlying Beego/DB bootstrap is recovered and returned as an error so a parent's mount fails cleanly (fail-closed) rather than crashing the whole process.
Types ¶
This section is empty.