Documentation
¶
Overview ¶
Package server is the proxy core: a data-plane listener that runs the negotiate → decode → one upstream call → encode pipeline, and an ops listener for /metrics, /health, /ready. The bundle is held behind an atomic.Pointer (set once at boot; reserved for future hot-swap).
Index ¶
- type Server
- func (s *Server) Bundle() *bundle.Bundle
- func (s *Server) DataHandler() http.Handler
- func (s *Server) Message(fullName string) (protoreflect.MessageDescriptor, error)
- func (s *Server) OpsHandler() http.Handler
- func (s *Server) ReloadBundle() error
- func (s *Server) Run(ctx context.Context) error
- func (s *Server) SetBundle(b *bundle.Bundle)
- func (s *Server) SetLogger(l *slog.Logger)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) DataHandler ¶
func (*Server) Message ¶
func (s *Server) Message(fullName string) (protoreflect.MessageDescriptor, error)
Message implements adapter.MessageResolver against the current bundle.
func (*Server) OpsHandler ¶
OpsHandler serves the ops surface: Prometheus /metrics, liveness/readiness probes (/health, /ready), and pprof. It is intentionally bound to the ops listener (WAVEFRONT_METRICS_ADDR) only — pprof must never be reachable on the data plane, and is registered explicitly on this mux, not the global DefaultServeMux.
func (*Server) ReloadBundle ¶ added in v0.4.0
ReloadBundle re-reads the bundle directory configured on the server and, on success, atomically swaps the live bundle. On failure, the previous bundle is preserved and the error is both logged and returned so the caller (typically a SIGHUP handler) can decide whether to react further. In-flight requests continue against the bundle they observed at the start of the request — the proxy reads the bundle pointer once per request.