responsewriter

package
v1.11.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2024 License: BSD-3-Clause Imports: 9 Imported by: 4

Documentation

Index

Constants

View Source
const (
	Writer_Write_FullMethodName       = "/http.responsewriter.Writer/Write"
	Writer_WriteHeader_FullMethodName = "/http.responsewriter.Writer/WriteHeader"
	Writer_Flush_FullMethodName       = "/http.responsewriter.Writer/Flush"
	Writer_Hijack_FullMethodName      = "/http.responsewriter.Writer/Hijack"
)

Variables

View Source
var File_http_responsewriter_responsewriter_proto protoreflect.FileDescriptor
View Source
var Writer_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "http.responsewriter.Writer",
	HandlerType: (*WriterServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Write",
			Handler:    _Writer_Write_Handler,
		},
		{
			MethodName: "WriteHeader",
			Handler:    _Writer_WriteHeader_Handler,
		},
		{
			MethodName: "Flush",
			Handler:    _Writer_Flush_Handler,
		},
		{
			MethodName: "Hijack",
			Handler:    _Writer_Hijack_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "http/responsewriter/responsewriter.proto",
}

Writer_ServiceDesc is the grpc.ServiceDesc for Writer service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterWriterServer

func RegisterWriterServer(s grpc.ServiceRegistrar, srv WriterServer)

Types

type Header struct {

	// key is a element key in a key value pair
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// values are a list of strings coresponding to the key
	Values []string `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

func (*Header) Descriptor deprecated

func (*Header) Descriptor() ([]byte, []int)

Deprecated: Use Header.ProtoReflect.Descriptor instead.

func (*Header) GetKey

func (x *Header) GetKey() string

func (*Header) GetValues

func (x *Header) GetValues() []string

func (*Header) ProtoMessage

func (*Header) ProtoMessage()

func (*Header) ProtoReflect

func (x *Header) ProtoReflect() protoreflect.Message

func (*Header) Reset

func (x *Header) Reset()

func (*Header) String

func (x *Header) String() string

type HijackResponse

type HijackResponse struct {

	// local_network is the name of the network (for example, "tcp", "udp")
	LocalNetwork string `protobuf:"bytes,1,opt,name=local_network,json=localNetwork,proto3" json:"local_network,omitempty"`
	// local_string is string form of address
	LocalString string `protobuf:"bytes,2,opt,name=local_string,json=localString,proto3" json:"local_string,omitempty"`
	// remote_network is the name of the network (for example, "tcp", "udp")
	RemoteNetwork string `protobuf:"bytes,3,opt,name=remote_network,json=remoteNetwork,proto3" json:"remote_network,omitempty"`
	// remote_string is string form of address
	RemoteString string `protobuf:"bytes,4,opt,name=remote_string,json=remoteString,proto3" json:"remote_string,omitempty"`
	// server_addr is the address of the gRPC server serving the Conn, Reader
	// and Writer services which facilitate Hijacking
	ServerAddr string `protobuf:"bytes,5,opt,name=server_addr,json=serverAddr,proto3" json:"server_addr,omitempty"`
	// contains filtered or unexported fields
}

func (*HijackResponse) Descriptor deprecated

func (*HijackResponse) Descriptor() ([]byte, []int)

Deprecated: Use HijackResponse.ProtoReflect.Descriptor instead.

func (*HijackResponse) GetLocalNetwork

func (x *HijackResponse) GetLocalNetwork() string

func (*HijackResponse) GetLocalString

func (x *HijackResponse) GetLocalString() string

func (*HijackResponse) GetRemoteNetwork

func (x *HijackResponse) GetRemoteNetwork() string

func (*HijackResponse) GetRemoteString

func (x *HijackResponse) GetRemoteString() string

func (*HijackResponse) GetServerAddr

func (x *HijackResponse) GetServerAddr() string

func (*HijackResponse) ProtoMessage

func (*HijackResponse) ProtoMessage()

func (*HijackResponse) ProtoReflect

func (x *HijackResponse) ProtoReflect() protoreflect.Message

func (*HijackResponse) Reset

func (x *HijackResponse) Reset()

func (*HijackResponse) String

func (x *HijackResponse) String() string

type UnimplementedWriterServer

type UnimplementedWriterServer struct {
}

UnimplementedWriterServer must be embedded to have forward compatible implementations.

func (UnimplementedWriterServer) Flush

func (UnimplementedWriterServer) Hijack

func (UnimplementedWriterServer) Write

func (UnimplementedWriterServer) WriteHeader

type UnsafeWriterServer

type UnsafeWriterServer interface {
	// contains filtered or unexported methods
}

UnsafeWriterServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to WriterServer will result in compilation errors.

type WriteHeaderRequest

type WriteHeaderRequest struct {

	// headers represents the key-value pairs in an HTTP header
	Headers []*Header `protobuf:"bytes,1,rep,name=headers,proto3" json:"headers,omitempty"`
	// status_code must be a valid HTTP 1xx-5xx status code
	StatusCode int32 `protobuf:"varint,2,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
	// contains filtered or unexported fields
}

func (*WriteHeaderRequest) Descriptor deprecated

func (*WriteHeaderRequest) Descriptor() ([]byte, []int)

Deprecated: Use WriteHeaderRequest.ProtoReflect.Descriptor instead.

func (*WriteHeaderRequest) GetHeaders

func (x *WriteHeaderRequest) GetHeaders() []*Header

func (*WriteHeaderRequest) GetStatusCode

func (x *WriteHeaderRequest) GetStatusCode() int32

func (*WriteHeaderRequest) ProtoMessage

func (*WriteHeaderRequest) ProtoMessage()

func (*WriteHeaderRequest) ProtoReflect

func (x *WriteHeaderRequest) ProtoReflect() protoreflect.Message

func (*WriteHeaderRequest) Reset

func (x *WriteHeaderRequest) Reset()

func (*WriteHeaderRequest) String

func (x *WriteHeaderRequest) String() string

type WriteRequest

type WriteRequest struct {

	// headers represents the key-value pairs in an HTTP header
	Headers []*Header `protobuf:"bytes,1,rep,name=headers,proto3" json:"headers,omitempty"`
	// payload is the write request in bytes
	Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

func (*WriteRequest) Descriptor deprecated

func (*WriteRequest) Descriptor() ([]byte, []int)

Deprecated: Use WriteRequest.ProtoReflect.Descriptor instead.

func (*WriteRequest) GetHeaders

func (x *WriteRequest) GetHeaders() []*Header

func (*WriteRequest) GetPayload

func (x *WriteRequest) GetPayload() []byte

func (*WriteRequest) ProtoMessage

func (*WriteRequest) ProtoMessage()

func (*WriteRequest) ProtoReflect

func (x *WriteRequest) ProtoReflect() protoreflect.Message

func (*WriteRequest) Reset

func (x *WriteRequest) Reset()

func (*WriteRequest) String

func (x *WriteRequest) String() string

type WriteResponse

type WriteResponse struct {

	// written is the number of bytes written in body
	Written int32 `protobuf:"varint,1,opt,name=written,proto3" json:"written,omitempty"`
	// contains filtered or unexported fields
}

func (*WriteResponse) Descriptor deprecated

func (*WriteResponse) Descriptor() ([]byte, []int)

Deprecated: Use WriteResponse.ProtoReflect.Descriptor instead.

func (*WriteResponse) GetWritten

func (x *WriteResponse) GetWritten() int32

func (*WriteResponse) ProtoMessage

func (*WriteResponse) ProtoMessage()

func (*WriteResponse) ProtoReflect

func (x *WriteResponse) ProtoReflect() protoreflect.Message

func (*WriteResponse) Reset

func (x *WriteResponse) Reset()

func (*WriteResponse) String

func (x *WriteResponse) String() string

type WriterClient

type WriterClient interface {
	// Write writes the data to the connection as part of an HTTP reply
	Write(ctx context.Context, in *WriteRequest, opts ...grpc.CallOption) (*WriteResponse, error)
	// WriteHeader sends an HTTP response header with the provided
	// status code
	WriteHeader(ctx context.Context, in *WriteHeaderRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Flush is a no-op
	Flush(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Hijack lets the caller take over the connection
	Hijack(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*HijackResponse, error)
}

WriterClient is the client API for Writer service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewWriterClient

func NewWriterClient(cc grpc.ClientConnInterface) WriterClient

type WriterServer

type WriterServer interface {
	// Write writes the data to the connection as part of an HTTP reply
	Write(context.Context, *WriteRequest) (*WriteResponse, error)
	// WriteHeader sends an HTTP response header with the provided
	// status code
	WriteHeader(context.Context, *WriteHeaderRequest) (*emptypb.Empty, error)
	// Flush is a no-op
	Flush(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
	// Hijack lets the caller take over the connection
	Hijack(context.Context, *emptypb.Empty) (*HijackResponse, error)
	// contains filtered or unexported methods
}

WriterServer is the server API for Writer service. All implementations must embed UnimplementedWriterServer for forward compatibility

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL