Documentation
¶
Overview ¶
Package rpc dispatches POST /api/v1/method/{app}.{module}.{method} requests to registered api.MethodHandler implementations, enforcing AllowedRoles through the shared perm.Engine path (TAD §9.2).
See PRD §14.3 and TAD §9.2 for the full specification. Implemented in Phase 6.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DispatchHandler ¶
func DispatchHandler(permEngine perm.Engine) http.HandlerFunc
DispatchHandler handles RPC method dispatch for /api/v1/method/{app}.{module}.{method} or /api/v1/method/*
func RegisterMethod ¶
func RegisterMethod(name string, h MethodHandler, opts MethodOpts)
RegisterMethod registers a custom RPC method.
func ResetRegistry ¶
func ResetRegistry()
ResetRegistry clears all registered RPC methods (useful for testing).
Types ¶
type MethodHandler ¶
MethodHandler handles custom RPC method requests per PRD §14.3 / TAD §9.2.
type MethodOpts ¶
type RegisteredMethod ¶
type RegisteredMethod struct {
Name string
Handler MethodHandler
Opts MethodOpts
}
func GetMethod ¶
func GetMethod(name string) (RegisteredMethod, bool)
GetMethod retrieves a registered RPC method by name.
func Methods ¶
func Methods() []RegisteredMethod
Methods returns a copy of every registered RPC method. Consumed by the agent ToolRegistry at compile time to emit one tool per role-gated method (TAD §10.1 step 8).