Versions in this module Expand all Collapse all v0 v0.2.1 Mar 4, 2026 v0.2.0 Feb 19, 2026 Changes in this version + const CodeAlreadyExists + const CodeInternal + const CodeNotFound + const CodePermissionDenied + const CodeRateLimited + const CodeUnauthenticated + const CodeValidationError + func GetAuthToken(r *http.Request) any + func HasUnsubstitutedParam(params map[string]string) bool + func ListenAndServe(addr string, handler http.Handler) error + func MatchPattern(pattern, path string) (map[string]string, bool) + func SetAuthToken(r *http.Request, token any) *http.Request + func SplitPath(path string) []string + func SubstituteParams(rpcParams map[string]string, routeParams map[string]string) map[string]string + func ToProtoBytes(v any) string + type Assets struct + CSS string + JS string + func LoadAssetsFromManifest(manifestPath string) Assets + type CORSConfig struct + AllowOrigin func(origin string) bool + AllowedHeaders []string + AllowedOrigins []string + type Dispatcher struct + Streaming map[string]StreamHandler + Unary map[string]UnaryHandler + func NewDispatcher(opts ...DispatcherOption) *Dispatcher + func (d *Dispatcher) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (d *Dispatcher) Use(m Middleware) + type DispatcherOption func(*Dispatcher) + func WithCORS(config CORSConfig) DispatcherOption + type MessageReader struct + func NewMessageReader(data []byte) *MessageReader + func (r *MessageReader) Next() ([]byte, error) + type Middleware func(next RpcHandler) RpcHandler + func AuthMiddleware(validate func(r *http.Request) any) Middleware + type PreloadEngine struct + PreloadFunc PreloadFunc + Routes []RouteSpec + func NewPreloadEngine(config PreloadEngineConfig) *PreloadEngine + func (p *PreloadEngine) HandlePreloadEndpoint(w http.ResponseWriter, r *http.Request) + func (p *PreloadEngine) ServeHTML(w http.ResponseWriter, r *http.Request) + type PreloadEngineConfig struct + AppName string + ManifestPath string + PreloadFunc PreloadFunc + Routes []RouteSpec + type PreloadFunc func(ctx context.Context, r *http.Request, method string, params map[string]string) (request, response proto.Message, err error) + type PreloadedRpc struct + RequestBytes string + ResponseBytes string + type RouteSpec struct + Pattern string + Rpcs []RpcSpec + func MatchRoute(routes []RouteSpec, path string) (*RouteSpec, map[string]string) + type RpcError struct + Code string + Details map[string]string + Message string + func ErrAlreadyExists(msg string) *RpcError + func ErrInternal(msg string) *RpcError + func ErrNotFound(msg string) *RpcError + func ErrPermissionDenied(msg string) *RpcError + func ErrRateLimited(msg string) *RpcError + func ErrUnauthenticated(msg string) *RpcError + func ErrValidation(msg string) *RpcError + func (e *RpcError) Error() string + func (e *RpcError) WithDetails(details map[string]string) *RpcError + type RpcHandler func(w http.ResponseWriter, r *http.Request, method string, body []byte) ([]byte, error) + type RpcSpec struct + Method string + Params map[string]string + type StreamAdapter struct + func NewStreamAdapter(w http.ResponseWriter) *StreamAdapter + func (sa *StreamAdapter) Send(data []byte) error + func (sa *StreamAdapter) SendHeaders() error + type StreamHandler func(w http.ResponseWriter, r *http.Request, method string, body []byte) error + type UnaryHandler func(w http.ResponseWriter, r *http.Request, method string, body []byte) ([]byte, error) + func RequireAuth(handler UnaryHandler) UnaryHandler + type ViteManifest map[string]ViteManifestEntry + type ViteManifestEntry struct + CSS []string + File string + Src string