Documentation ¶
Index ¶
- Constants
- Variables
- type EchoGrpcHandler
- func (h *EchoGrpcHandler) Echo(ctx context.Context, s *nio.Conn, req *proto.EchoRequest) (*proto.EchoResponse, error)
- func (h *EchoGrpcHandler) ForwardEcho(ctx context.Context, req *proto.ForwardEchoRequest) (*proto.ForwardEchoResponse, error)
- func (h *EchoGrpcHandler) ServeHTTP(writer http.ResponseWriter, request *http.Request)
- type Field
Constants ¶
View Source
const (
ConnectionTimeout = 2 * time.Second
)
Variables ¶
View Source
var ( StatusCodeOK = strconv.Itoa(http.StatusOK) StatusCodeForbidden = strconv.Itoa(http.StatusForbidden) StatusCodeBadRequest = strconv.Itoa(http.StatusBadRequest) StatusCodeTooManyRequests = strconv.Itoa(http.StatusTooManyRequests) )
View Source
var DefaultRequestTimeout = 5 * time.Second
Functions ¶
This section is empty.
Types ¶
type EchoGrpcHandler ¶
func (*EchoGrpcHandler) Echo ¶
func (h *EchoGrpcHandler) Echo(ctx context.Context, s *nio.Conn, req *proto.EchoRequest) (*proto.EchoResponse, error)
func (*EchoGrpcHandler) ForwardEcho ¶
func (h *EchoGrpcHandler) ForwardEcho(ctx context.Context, req *proto.ForwardEchoRequest) (*proto.ForwardEchoResponse, error)
func (*EchoGrpcHandler) ServeHTTP ¶
func (h *EchoGrpcHandler) ServeHTTP(writer http.ResponseWriter, request *http.Request)
Handle /grpc/ requests, equivalent with forward
type Field ¶
type Field string
Field is a list of fields returned in responses from the Echo server.
const ( RequestIDField Field = "X-Request-Id" ServiceVersionField Field = "ServiceVersion" ServicePortField Field = "ServicePort" StatusCodeField Field = "StatusCode" URLField Field = "URL" HostField Field = "Host" HostnameField Field = "Hostname" MethodField Field = "Method" ResponseHeader Field = "ResponseHeader" ClusterField Field = "Cluster" IstioVersionField Field = "IstioVersion" IPField Field = "IP" // The Requester’s IP Address. )
Click to show internal directories.
Click to hide internal directories.