mirror of
https://github.com/ngrok/ngrok-go.git
synced 2026-05-17 16:50:45 +00:00
6bc8021c53
See CHANGELOG.md for details.
21 lines
537 B
Go
21 lines
537 B
Go
package ngrok
|
|
|
|
import (
|
|
"context"
|
|
|
|
"golang.ngrok.com/ngrok/v2/rpc"
|
|
)
|
|
|
|
// RPCHandler is a function that processes RPC requests from the ngrok service.
|
|
// It receives the context, agent session, and request, and returns an optional
|
|
// response payload and error.
|
|
type RPCHandler func(context.Context, AgentSession, rpc.Request) ([]byte, error)
|
|
|
|
// Private request implementation that satisfies the rpc.Request interface
|
|
type rpcRequest struct {
|
|
method string
|
|
payload []byte
|
|
}
|
|
|
|
func (r *rpcRequest) Method() string { return r.method }
|