Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
WebhookCh chan WebhookEvent
StatusCh chan StatusEvent
// contains filtered or unexported fields
}
Client orchestrates the tunnel connection and exposes event channels for the TUI to consume.
type Config ¶
type Config struct {
ServerAddr string `mapstructure:"server"`
Token string `mapstructure:"token"`
ForwardURL string `mapstructure:"forward"`
TLS bool `mapstructure:"tls"`
ReconnectInterval time.Duration `mapstructure:"reconnect_interval"`
MaxReconnectInterval time.Duration `mapstructure:"max_reconnect_interval"`
ForwardTimeout time.Duration `mapstructure:"forward_timeout"`
}
func DefaultConfig ¶
func DefaultConfig() Config
type Forwarder ¶
type Forwarder struct {
// contains filtered or unexported fields
}
Forwarder replays incoming webhook requests against a local HTTP target.
func (*Forwarder) Forward ¶
func (f *Forwarder) Forward(ctx context.Context, req *hookerv1.WebhookRequest) (*hookerv1.WebhookResponse, error)
Forward replays a WebhookRequest to the local target and returns the captured response. The returned WebhookResponse has request_id set for correlation in sync mode.
type StatusEvent ¶
StatusEvent communicates connection state changes to the TUI.
type Tunnel ¶
type Tunnel struct {
// contains filtered or unexported fields
}
Tunnel maintains a persistent gRPC connection to the server.
func NewTunnel ¶
func NewTunnel(cfg Config, logger *slog.Logger, webhookCh chan WebhookEvent, statusCh chan StatusEvent) *Tunnel
type WebhookEvent ¶
type WebhookEvent struct {
Request *hookerv1.WebhookRequest
Response *hookerv1.WebhookResponse
Error error
ReceivedAt time.Time
Duration time.Duration
}
WebhookEvent is sent to the TUI whenever a webhook is received and forwarded.
Click to show internal directories.
Click to hide internal directories.