Versions in this module Expand all Collapse all v0 v0.31.0 Jun 2, 2026 Changes in this version + const HookOnConnect + const HookOnDisconnect + const HookOnRequest + const HookOnResponse + const MethodConfigure + const MethodLog + const MethodReady + const MethodSetSpeed + const MethodSetTargets + func BuildPlugins(paths []string) error + func MarshalEnvelope(hook HookType, data interface{}) ([]byte, error) + type AuthorizeResult struct + Allow bool + Body string + CleanQuery bool + Drop bool + Fallback bool + Headers map[string]string + RewritePath string + SpeedLimit *SpeedLimit + Status int + type Binding struct + Balancer balancer.Balancer + Match *MatchInfo + Name string + Plugin string + RouteID string + Timeout time.Duration + type Caller struct + func NewCaller(socketPath string, poolSize int, timeout time.Duration) *Caller + func (c *Caller) CallConnect(ctx context.Context, conn *ConnInfo) (*ConnResult, error) + func (c *Caller) CallRequest(ctx context.Context, req *RequestInfo) (*AuthorizeResult, error) + func (c *Caller) CallResponse(ctx context.Context, req *RequestInfo, resp *UpstreamResponseInfo) (*ResponseModResult, error) + func (c *Caller) Close() + func (c *Caller) Fire(frame []byte) error + type ConfigureParams struct + Match *MatchInfo + RouteID string + type ConnInfo struct + Domain string + MatchDomain string + MatchGlob string + RemoteAddr string + RouteID string + type ConnResult struct + Allow bool + type DisconnectInfo struct + BytesRx int64 + BytesTx int64 + DurationMs int64 + RemoteAddr string + RouteID string + Target string + type Envelope struct + Data []byte + Hook HookType + type HookType byte + const HookTypeConnect + const HookTypeDisconnect + const HookTypeRequest + const HookTypeResponse + type Manager struct + func NewManager() *Manager + func (m *Manager) Configure(bindings []*Binding, routes map[string]*RouteInfo) + func (m *Manager) GetSpeedLimit(routeID string) SpeedEntry + func (m *Manager) GroupBuckets() *throttle.GroupRegistry + func (m *Manager) HasHook(routeID string, hook string) bool + func (m *Manager) OnConnect(ctx context.Context, routeID string, conn *ConnInfo) (*ConnResult, error) + func (m *Manager) OnDisconnect(routeID string, info *DisconnectInfo) + func (m *Manager) OnRequest(ctx context.Context, routeID string, req *RequestInfo) (*AuthorizeResult, error) + func (m *Manager) OnResponse(ctx context.Context, routeID string, req *RequestInfo, ...) (*ResponseModResult, error) + func (m *Manager) Reconfigure(bindings []*Binding, routes map[string]*RouteInfo) + func (m *Manager) Start(ctx context.Context) error + func (m *Manager) Stop() + type MatchInfo struct + Domain string + Path string + type Process struct + func (p *Process) Done() <-chan struct{} + func (p *Process) Pushes() <-chan Push + func (p *Process) Send(req Request) error + func (p *Process) Stop() + type Push struct + Method string + Params PushParams + type PushParams struct + Action string + Args []any + DownloadMbps float64 + GroupKey string + Groups map[string][]string + Hooks []string + Level string + Message string + RouteID string + Socket string + Targets []string + UploadMbps float64 + type Request struct + Method string + Params interface{} + type RequestInfo struct + Body []byte + ContentLength int64 + Domain string + Headers map[string]string + Host string + MatchDomain string + MatchGlob string + MatchPath string + Method string + Path string + Proto string + Query string + RemoteAddr string + RouteID string + Target string + Vars map[string]string + type Response struct + Error string + Result string + type ResponseModResult struct + Headers map[string]string + Remove []string + Status int + type ResponsePair struct + Req RequestInfo + Resp UpstreamResponseInfo + type RouteInfo struct + Action string + Balancer balancer.Balancer + type SpeedEntry struct + DownloadBps int64 + UploadBps int64 + type SpeedLimit struct + DownloadMbps float64 + GroupKey string + UploadMbps float64 + type UpstreamResponseInfo struct + Headers map[string]string + Status int