Update to use go modules (#671)

This includes updates to CI config, vendor files, etc.
I've hard-coded the k8s depedency at 1.13.4 to keep it inline with what
we currently have and to make sure a another run of `go mod tidy`
doesn't accidentally update it to an unexpected version.

Thanks to hectorj2f for carrying this along.
This commit is contained in:
Brian Goff
2019-06-19 08:17:22 -07:00
committed by Pires
parent f6f6c46b53
commit 77069e63e5
954 changed files with 138902 additions and 251590 deletions

View File

@@ -1,17 +1,17 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: opencensus/proto/agent/trace/v1/trace_service.proto
package v1 // import "github.com/census-instrumentation/opencensus-proto/gen-go/agent/trace/v1"
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import v1 "github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1"
import v11 "github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1"
package v1
import (
context "golang.org/x/net/context"
context "context"
fmt "fmt"
v1 "github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1"
v12 "github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1"
v11 "github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
@@ -23,11 +23,12 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type CurrentLibraryConfig struct {
// Identifier data effectively is a structured metadata.
// This is required only in the first message on the stream.
// This is required only in the first message on the stream or if the
// previous sent CurrentLibraryConfig message has a different Node (e.g.
// when the same RPC is used to configure multiple Applications).
Node *v1.Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
// Current configuration.
Config *v11.TraceConfig `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"`
@@ -40,16 +41,17 @@ func (m *CurrentLibraryConfig) Reset() { *m = CurrentLibraryConfig{} }
func (m *CurrentLibraryConfig) String() string { return proto.CompactTextString(m) }
func (*CurrentLibraryConfig) ProtoMessage() {}
func (*CurrentLibraryConfig) Descriptor() ([]byte, []int) {
return fileDescriptor_trace_service_b7083cd65a1a253c, []int{0}
return fileDescriptor_7027f99caf7ac6a5, []int{0}
}
func (m *CurrentLibraryConfig) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CurrentLibraryConfig.Unmarshal(m, b)
}
func (m *CurrentLibraryConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CurrentLibraryConfig.Marshal(b, m, deterministic)
}
func (dst *CurrentLibraryConfig) XXX_Merge(src proto.Message) {
xxx_messageInfo_CurrentLibraryConfig.Merge(dst, src)
func (m *CurrentLibraryConfig) XXX_Merge(src proto.Message) {
xxx_messageInfo_CurrentLibraryConfig.Merge(m, src)
}
func (m *CurrentLibraryConfig) XXX_Size() int {
return xxx_messageInfo_CurrentLibraryConfig.Size(m)
@@ -75,6 +77,10 @@ func (m *CurrentLibraryConfig) GetConfig() *v11.TraceConfig {
}
type UpdatedLibraryConfig struct {
// This field is ignored when the RPC is used to configure only one Application.
// This is required only in the first message on the stream or if the
// previous sent UpdatedLibraryConfig message has a different Node.
Node *v1.Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
// Requested updated configuration.
Config *v11.TraceConfig `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
@@ -86,16 +92,17 @@ func (m *UpdatedLibraryConfig) Reset() { *m = UpdatedLibraryConfig{} }
func (m *UpdatedLibraryConfig) String() string { return proto.CompactTextString(m) }
func (*UpdatedLibraryConfig) ProtoMessage() {}
func (*UpdatedLibraryConfig) Descriptor() ([]byte, []int) {
return fileDescriptor_trace_service_b7083cd65a1a253c, []int{1}
return fileDescriptor_7027f99caf7ac6a5, []int{1}
}
func (m *UpdatedLibraryConfig) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_UpdatedLibraryConfig.Unmarshal(m, b)
}
func (m *UpdatedLibraryConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_UpdatedLibraryConfig.Marshal(b, m, deterministic)
}
func (dst *UpdatedLibraryConfig) XXX_Merge(src proto.Message) {
xxx_messageInfo_UpdatedLibraryConfig.Merge(dst, src)
func (m *UpdatedLibraryConfig) XXX_Merge(src proto.Message) {
xxx_messageInfo_UpdatedLibraryConfig.Merge(m, src)
}
func (m *UpdatedLibraryConfig) XXX_Size() int {
return xxx_messageInfo_UpdatedLibraryConfig.Size(m)
@@ -106,6 +113,13 @@ func (m *UpdatedLibraryConfig) XXX_DiscardUnknown() {
var xxx_messageInfo_UpdatedLibraryConfig proto.InternalMessageInfo
func (m *UpdatedLibraryConfig) GetNode() *v1.Node {
if m != nil {
return m.Node
}
return nil
}
func (m *UpdatedLibraryConfig) GetConfig() *v11.TraceConfig {
if m != nil {
return m.Config
@@ -114,29 +128,37 @@ func (m *UpdatedLibraryConfig) GetConfig() *v11.TraceConfig {
}
type ExportTraceServiceRequest struct {
// Identifier data effectively is a structured metadata.
// This is required only in the first message on the stream.
Node *v1.Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
Spans []*v11.Span `protobuf:"bytes,2,rep,name=spans,proto3" json:"spans,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
// This is required only in the first message on the stream or if the
// previous sent ExportTraceServiceRequest message has a different Node (e.g.
// when the same RPC is used to send Spans from multiple Applications).
Node *v1.Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
// A list of Spans that belong to the last received Node.
Spans []*v11.Span `protobuf:"bytes,2,rep,name=spans,proto3" json:"spans,omitempty"`
// The resource for the spans in this message that do not have an explicit
// resource set.
// If unset, the most recently set resource in the RPC stream applies. It is
// valid to never be set within a stream, e.g. when no resource info is known.
Resource *v12.Resource `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ExportTraceServiceRequest) Reset() { *m = ExportTraceServiceRequest{} }
func (m *ExportTraceServiceRequest) String() string { return proto.CompactTextString(m) }
func (*ExportTraceServiceRequest) ProtoMessage() {}
func (*ExportTraceServiceRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_trace_service_b7083cd65a1a253c, []int{2}
return fileDescriptor_7027f99caf7ac6a5, []int{2}
}
func (m *ExportTraceServiceRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ExportTraceServiceRequest.Unmarshal(m, b)
}
func (m *ExportTraceServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ExportTraceServiceRequest.Marshal(b, m, deterministic)
}
func (dst *ExportTraceServiceRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_ExportTraceServiceRequest.Merge(dst, src)
func (m *ExportTraceServiceRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_ExportTraceServiceRequest.Merge(m, src)
}
func (m *ExportTraceServiceRequest) XXX_Size() int {
return xxx_messageInfo_ExportTraceServiceRequest.Size(m)
@@ -161,6 +183,13 @@ func (m *ExportTraceServiceRequest) GetSpans() []*v11.Span {
return nil
}
func (m *ExportTraceServiceRequest) GetResource() *v12.Resource {
if m != nil {
return m.Resource
}
return nil
}
type ExportTraceServiceResponse struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
@@ -171,16 +200,17 @@ func (m *ExportTraceServiceResponse) Reset() { *m = ExportTraceServiceRe
func (m *ExportTraceServiceResponse) String() string { return proto.CompactTextString(m) }
func (*ExportTraceServiceResponse) ProtoMessage() {}
func (*ExportTraceServiceResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_trace_service_b7083cd65a1a253c, []int{3}
return fileDescriptor_7027f99caf7ac6a5, []int{3}
}
func (m *ExportTraceServiceResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ExportTraceServiceResponse.Unmarshal(m, b)
}
func (m *ExportTraceServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ExportTraceServiceResponse.Marshal(b, m, deterministic)
}
func (dst *ExportTraceServiceResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_ExportTraceServiceResponse.Merge(dst, src)
func (m *ExportTraceServiceResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_ExportTraceServiceResponse.Merge(m, src)
}
func (m *ExportTraceServiceResponse) XXX_Size() int {
return xxx_messageInfo_ExportTraceServiceResponse.Size(m)
@@ -198,6 +228,41 @@ func init() {
proto.RegisterType((*ExportTraceServiceResponse)(nil), "opencensus.proto.agent.trace.v1.ExportTraceServiceResponse")
}
func init() {
proto.RegisterFile("opencensus/proto/agent/trace/v1/trace_service.proto", fileDescriptor_7027f99caf7ac6a5)
}
var fileDescriptor_7027f99caf7ac6a5 = []byte{
// 423 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x54, 0xbf, 0x6b, 0xdb, 0x40,
0x14, 0xee, 0xd9, 0xad, 0x28, 0xe7, 0x2e, 0x15, 0x1d, 0x54, 0x51, 0xb0, 0x11, 0xb4, 0x18, 0x5a,
0x9d, 0x2a, 0x1b, 0x2f, 0x2e, 0x74, 0xb0, 0x29, 0x74, 0x28, 0xc5, 0xc8, 0xed, 0x92, 0xc5, 0xc8,
0xd2, 0x8b, 0xa2, 0xc1, 0x77, 0xca, 0xdd, 0x49, 0x24, 0x90, 0x2d, 0x43, 0xf6, 0x0c, 0xf9, 0xc3,
0xf2, 0x17, 0x05, 0xdd, 0xc9, 0x3f, 0x12, 0x5b, 0x11, 0x24, 0x4b, 0xb6, 0x87, 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, 0x16, 0x52, 0x61, 0xb5, 0x7a, 0xed, 0x7e, 0x67, 0xd0, 0x7d,
0xc4, 0xd8, 0x3c, 0x0b, 0x69, 0xa0, 0xd1, 0xe6, 0x04, 0xbf, 0x5d, 0x27, 0xc4, 0x6a, 0xd7, 0x1d,
0xbb, 0xc9, 0x50, 0xe1, 0x93, 0xa0, 0xaa, 0x83, 0x0d, 0xcf, 0xf9, 0x84, 0xed, 0x43, 0x33, 0x89,
0x8c, 0x51, 0x01, 0x83, 0x9b, 0x16, 0x7e, 0xb7, 0xdb, 0x30, 0x2f, 0xb0, 0x51, 0x6d, 0x62, 0x44,
0x1a, 0x9e, 0x02, 0x39, 0x94, 0x2a, 0xbb, 0x99, 0x76, 0x68, 0xef, 0xce, 0xab, 0x3e, 0xfa, 0x8e,
0xcc, 0x2b, 0x84, 0x0d, 0xed, 0xd6, 0x1c, 0x37, 0xea, 0xd4, 0xae, 0xca, 0xfe, 0xf1, 0x24, 0xae,
0xbe, 0x12, 0xed, 0x64, 0x72, 0x89, 0xb0, 0x93, 0xb2, 0x26, 0x9d, 0xc9, 0xfb, 0x5d, 0x89, 0x59,
0x89, 0x98, 0xa1, 0xa3, 0xdf, 0x49, 0x2a, 0x4f, 0xf2, 0x65, 0x19, 0x05, 0x4f, 0x93, 0xdd, 0x94,
0x0a, 0xc9, 0xf3, 0x15, 0x50, 0x19, 0xca, 0x94, 0x51, 0x6f, 0xab, 0xeb, 0xea, 0x17, 0x9c, 0x00,
0x75, 0x93, 0x87, 0x7f, 0xa8, 0xa5, 0xa1, 0x9a, 0xc3, 0xbb, 0x00, 0x00, 0x00, 0xff, 0xff, 0xcf,
0x9c, 0x9b, 0xf7, 0xcb, 0x04, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
@@ -210,11 +275,10 @@ const _ = grpc.SupportPackageIsVersion4
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type TraceServiceClient interface {
// After initialization, this RPC must be kept alive for the
// entire life of the application. The agent pushes configs
// down to applications via a stream.
// After initialization, this RPC must be kept alive for the entire life of
// the application. The agent pushes configs down to applications via a
// stream.
Config(ctx context.Context, opts ...grpc.CallOption) (TraceService_ConfigClient, error)
// Allows applications to send spans to the agent.
// For performance reasons, it is recommended to keep this RPC
// alive for the entire life of the application.
Export(ctx context.Context, opts ...grpc.CallOption) (TraceService_ExportClient, error)
@@ -292,11 +356,10 @@ func (x *traceServiceExportClient) Recv() (*ExportTraceServiceResponse, error) {
// TraceServiceServer is the server API for TraceService service.
type TraceServiceServer interface {
// After initialization, this RPC must be kept alive for the
// entire life of the application. The agent pushes configs
// down to applications via a stream.
// After initialization, this RPC must be kept alive for the entire life of
// the application. The agent pushes configs down to applications via a
// stream.
Config(TraceService_ConfigServer) error
// Allows applications to send spans to the agent.
// For performance reasons, it is recommended to keep this RPC
// alive for the entire life of the application.
Export(TraceService_ExportServer) error
@@ -378,36 +441,3 @@ var _TraceService_serviceDesc = grpc.ServiceDesc{
},
Metadata: "opencensus/proto/agent/trace/v1/trace_service.proto",
}
func init() {
proto.RegisterFile("opencensus/proto/agent/trace/v1/trace_service.proto", fileDescriptor_trace_service_b7083cd65a1a253c)
}
var fileDescriptor_trace_service_b7083cd65a1a253c = []byte{
// 389 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0xb1, 0x4e, 0xe3, 0x40,
0x10, 0xbd, 0xcd, 0xdd, 0xb9, 0xd8, 0x5c, 0x73, 0x56, 0x8a, 0x60, 0x21, 0x25, 0xb2, 0x04, 0x4a,
0x81, 0xd7, 0x24, 0x51, 0x9a, 0x20, 0x51, 0x24, 0x42, 0xa2, 0x40, 0x28, 0x72, 0x80, 0x82, 0x26,
0x72, 0xec, 0xc1, 0xb8, 0xc8, 0xae, 0xd9, 0x5d, 0x5b, 0x20, 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 0x3c, 0xc0, 0x7f, 0x45, 0xe2, 0x53, 0xd1, 0xac, 0xb5, 0x7f, 0x77, 0xea,
0xbd, 0xd6, 0x37, 0xc6, 0xa6, 0x89, 0x4f, 0x3d, 0x8d, 0xb6, 0x77, 0xb1, 0xb5, 0xc9, 0x8f, 0x48,
0x18, 0x15, 0xd0, 0x7b, 0xab, 0xe1, 0x7f, 0xab, 0x0d, 0xf3, 0x11, 0x1b, 0x45, 0x12, 0x03, 0x52,
0xf1, 0x73, 0x91, 0x4d, 0x4b, 0xb5, 0xaa, 0x69, 0x9b, 0x72, 0xb7, 0x7f, 0x75, 0xd0, 0x21, 0x32,
0x9f, 0x11, 0x36, 0xb4, 0x5b, 0x73, 0x58, 0xa9, 0x53, 0x1a, 0xb3, 0x75, 0xf4, 0x23, 0xae, 0x8e,
0x44, 0x3b, 0x19, 0x3d, 0x21, 0x6c, 0xc7, 0xac, 0x4a, 0x67, 0xf4, 0x7f, 0x55, 0x62, 0x92, 0x23,
0x26, 0xe8, 0xfa, 0x34, 0x8a, 0xe5, 0x6d, 0x3a, 0xcf, 0xd7, 0xe8, 0x6a, 0xb2, 0x13, 0x53, 0x21,
0x79, 0xba, 0x00, 0x2a, 0x7d, 0x19, 0x33, 0xea, 0x2e, 0x75, 0x1d, 0x7d, 0x40, 0x11, 0x50, 0x27,
0xfa, 0x7c, 0xf3, 0x73, 0x43, 0x35, 0xfb, 0xef, 0x01, 0x00, 0x00, 0xff, 0xff, 0x74, 0xf9, 0xaa,
0xd2, 0x1d, 0x04, 0x00, 0x00,
}

View File

@@ -0,0 +1,154 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: opencensus/proto/agent/trace/v1/trace_service.proto
/*
Package v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package v1
import (
"io"
"net/http"
"github.com/golang/protobuf/proto"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/grpc-ecosystem/grpc-gateway/utilities"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/status"
)
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
func request_TraceService_Export_0(ctx context.Context, marshaler runtime.Marshaler, client TraceServiceClient, req *http.Request, pathParams map[string]string) (TraceService_ExportClient, runtime.ServerMetadata, error) {
var metadata runtime.ServerMetadata
stream, err := client.Export(ctx)
if err != nil {
grpclog.Infof("Failed to start streaming: %v", err)
return nil, metadata, err
}
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, berr
}
dec := marshaler.NewDecoder(newReader())
handleSend := func() error {
var protoReq ExportTraceServiceRequest
err := dec.Decode(&protoReq)
if err == io.EOF {
return err
}
if err != nil {
grpclog.Infof("Failed to decode request: %v", err)
return err
}
if err := stream.Send(&protoReq); err != nil {
grpclog.Infof("Failed to send request: %v", err)
return err
}
return nil
}
if err := handleSend(); err != nil {
if cerr := stream.CloseSend(); cerr != nil {
grpclog.Infof("Failed to terminate client stream: %v", cerr)
}
if err == io.EOF {
return stream, metadata, nil
}
return nil, metadata, err
}
go func() {
for {
if err := handleSend(); err != nil {
break
}
}
if err := stream.CloseSend(); err != nil {
grpclog.Infof("Failed to terminate client stream: %v", err)
}
}()
header, err := stream.Header()
if err != nil {
grpclog.Infof("Failed to get header from client: %v", err)
return nil, metadata, err
}
metadata.HeaderMD = header
return stream, metadata, nil
}
// RegisterTraceServiceHandlerFromEndpoint is same as RegisterTraceServiceHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterTraceServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.Dial(endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterTraceServiceHandler(ctx, mux, conn)
}
// RegisterTraceServiceHandler registers the http handlers for service TraceService to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterTraceServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterTraceServiceHandlerClient(ctx, mux, NewTraceServiceClient(conn))
}
// RegisterTraceServiceHandlerClient registers the http handlers for service TraceService
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TraceServiceClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TraceServiceClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "TraceServiceClient" to call the correct interceptors.
func RegisterTraceServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TraceServiceClient) error {
mux.Handle("POST", pattern_TraceService_Export_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_TraceService_Export_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_TraceService_Export_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_TraceService_Export_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "trace"}, ""))
)
var (
forward_TraceService_Export_0 = runtime.ForwardResponseStream
)