Documentation
¶
Overview ¶
Package platform is the public runtime façade a wrapper module imports to build and run the platform-api server. It is the only package needed to start things; pdk is the package a wrapper builds its plugins against. The split is clean — platform runs the server, pdk says what a plugin is and what it can reach.
The façade works entirely in terms of the external surface (pdk) and never exposes internal/plugin. It aliases the two contract types so a wrapper can call them either platform.Plugin / platform.Deps or pdk.Plugin / pdk.Deps.
Index ¶
Constants ¶
const ( // BeforePlatformChain is outermost — before CORS/auth, no identity yet. BeforePlatformChain = pdk.BeforePlatformChain // AfterPlatformChain is innermost — after auth + scope enforcement. AfterPlatformChain = pdk.AfterPlatformChain )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is a configured, ready-to-run platform-api server.
type ChainPosition ¶
type ChainPosition = pdk.ChainPosition
ChainPosition selects where a middleware sits in the chain.
type Option ¶
type Option func(*App)
Option configures an App. Options are applied in order; later options that set the same field win.
func WithConfig ¶
WithConfig supplies an already-built config, taking precedence over WithConfigPath.
func WithConfigPath ¶
WithConfigPath loads platform-api config from a TOML file (env > file > defaults). It points the shared config loader at the given path; the config is materialized in New. WithConfig takes precedence over this.
func WithLogger ¶
WithLogger supplies the logger. When omitted, one is derived from the config's log level and format.
func WithPlugin ¶
WithPlugin registers wrapper-owned extension modules — the one way a wrapper adds routes, scopes, and hooks. Each plugin implements pdk.Plugin and receives pdk.Deps in Init. Multiple calls accumulate; nil plugins are ignored.
type Plugin ¶
Plugin is what a wrapper implements — it receives pdk.Deps (capabilities), not raw repositories. Alias of pdk.Plugin.
type PositionedMiddleware ¶
type PositionedMiddleware = pdk.PositionedMiddleware
PositionedMiddleware pairs a middleware with its chain position.