httptransport

package
v2.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodedResponseWriter

type CodedResponseWriter struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

CodedResponseWriter saves a response code to be read later.

func NewCodedWriter

func NewCodedWriter(w http.ResponseWriter) *CodedResponseWriter

NewCodedWriter wraps an existing http.ResponseWriter.

func (*CodedResponseWriter) Hijack

func (w *CodedResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)

Hijacker implements http.Hijacker.

Works only if given http.ResponseWriter implements .Hijack().

func (*CodedResponseWriter) ResponseCode

func (w *CodedResponseWriter) ResponseCode() int

ResponseCode returns a code that was written to the transport.

func (*CodedResponseWriter) Write

func (w *CodedResponseWriter) Write(b []byte) (int, error)

func (*CodedResponseWriter) WriteHeader

func (w *CodedResponseWriter) WriteHeader(statusCode int)

func (*CodedResponseWriter) Written

func (w *CodedResponseWriter) Written() bool

Written returns true if headers were written (or the whole response).

type DescOptions

type DescOptions struct {
	UnaryInterceptor   grpc.UnaryServerInterceptor
	SwaggerDefaultOpts []swagger.Option
}

DescOptions provides options for a ServiceDesc compiled code.

type MarshalerError

type MarshalerError struct {
	Err error
}

MarshalerError is returned by a marshaler func. It is used to decorate errors coming from gRPC-generated _Handler to distinguish parser errors from handlers' errors.

func NewMarshalerError

func NewMarshalerError(err error) MarshalerError

func (MarshalerError) Cause

func (m MarshalerError) Cause() error

func (MarshalerError) Error

func (m MarshalerError) Error() string

type OptionSwaggerOpts

type OptionSwaggerOpts struct {
	Options []swagger.Option
}

OptionSwaggerOpts sets up default options for the SwaggerDef().

func (OptionSwaggerOpts) Apply

func (o OptionSwaggerOpts) Apply(oo *DescOptions)

Apply implements transport.DescOption.

type OptionUnaryInterceptor

type OptionUnaryInterceptor struct {
	Interceptor grpc.UnaryServerInterceptor
}

OptionUnaryInterceptor sets up the gRPC unary interceptor.

func (OptionUnaryInterceptor) Apply

func (o OptionUnaryInterceptor) Apply(oo *DescOptions)

Apply implements transport.DescOption.

type TransportStream

type TransportStream struct {
	// contains filtered or unexported fields
}

TransportStream implements grpc.ServerTransportStream for the HTTP calls.

func NewTStream

func NewTStream(w http.ResponseWriter) *TransportStream

NewTStream creates and returns new TransportStream writing to supplied http.ResponseWriter.

func (*TransportStream) Method

func (ts *TransportStream) Method() string

Method implements grpc.ServerTransportStream.

func (*TransportStream) SendHeader

func (ts *TransportStream) SendHeader(md metadata.MD) error

SendHeader implements grpc.ServerTransportStream.

func (*TransportStream) SetHeader

func (ts *TransportStream) SetHeader(md metadata.MD) error

SetHeader implements grpc.ServerTransportStream.

func (*TransportStream) SetTrailer

func (ts *TransportStream) SetTrailer(md metadata.MD) error

SetTrailer implements grpc.ServerTransportStream.

Jump to

Keyboard shortcuts

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