Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Module = fx.Module( "harpoon", fx.Provide( newRuntimeConfig, newHarpoonService, newRuntimeRegistryCounter, newHarpoonGuardedMux, runtimeharpoon.NewHostBusSubscriber, runtimeharpoon.NewHostBus, runtimeharpoon.NewStartupCatalogDigestState, ), fx.Invoke(registerAdditionalTransport, runtimeharpoon.StartHostRegistration, runtimeharpoon.StartCatalogDigestLogging), )
Module keeps only the full-client Harpoon extensions while the registry, transport, lifecycle, and host-registration wiring live in runtimeharpoon.
Functions ¶
This section is empty.
Types ¶
type CallBuffer ¶
type CallBuffer struct {
// contains filtered or unexported fields
}
CallBuffer keeps a fixed-size ring buffer of recent calls.
func NewCallBuffer ¶
func NewCallBuffer() *CallBuffer
NewCallBuffer constructs a ring buffer for recent calls.
func (*CallBuffer) RecordCall ¶
func (b *CallBuffer) RecordCall(entry CallEntry)
RecordCall records a call entry into the ring buffer.
type CallEntry ¶
type CallEntry struct {
Timestamp time.Time `json:"timestamp"`
Label string `json:"label"`
URL string `json:"url"`
Method string `json:"method"`
Status int `json:"status"`
LatencyMS int `json:"latency_ms"`
ResponseContentType string `json:"response_content_type,omitempty"`
ReqBytes int `json:"req_bytes"`
RespBytes int `json:"resp_bytes"`
Error string `json:"error,omitempty"`
RequestBody string `json:"request_body,omitempty"`
ResponseBody string `json:"response_body,omitempty"`
ResponseBodyTransformed string `json:"response_body_transformed,omitempty"`
BodyIsBase64 bool `json:"body_is_base64,omitempty"`
}
CallEntry captures a recent harpoon call for the admin UI.
type Registry ¶
type Registry = runtimeharpoon.Registry
func NewRegistry ¶
NewRegistry constructs a registry backed by the shared runtime core.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the full-client adapter over the dependency-clean runtime core. It adds only the admin call receipt and OAuth audience capabilities that are intentionally absent from the customer runtime binaries.
func NewServer ¶
func NewServer(cfg *config.HarpoonConfig, registry *Registry, buffer *CallBuffer, logger *slog.Logger, opts ...ServerOption) (*Server, error)
NewServer constructs the full-client adapter over the shared runtime core.
type ServerOption ¶
type ServerOption = runtimeharpoon.ServerOption
ServerOption is the shared runtime-core option type.
func WithHTTPTransport ¶
func WithHTTPTransport(rt http.RoundTripper) ServerOption
WithHTTPTransport sets the HTTP transport used for Harpoon outbound calls.
func WithMeter ¶
func WithMeter(meter metric.Meter) ServerOption
WithMeter configures the meter used for Harpoon metrics.
type Target ¶
type Target = runtimeharpoon.Target
The runtime package owns routing and allowlist behavior. Keep full-client names as aliases so existing callers remain source-compatible.
type TargetRegistrar ¶
type TargetRegistrar = runtimeharpoon.TargetRegistrar
TargetRegistrar is the shared runtime-core registration contract.
func WithTarget ¶
func WithTarget(target Target) TargetRegistrar
WithTarget returns a registrar that registers the provided target.