kubernetes/vendor/google.golang.org/grpc/stream.go

var metadataFromOutgoingContextRaw

type StreamHandler

type StreamDesc

type Stream

type ClientStream

// NewStream creates a new Stream for the client side. This is typically
// called by generated code. ctx is used for the lifetime of the stream.
//
// To ensure resources are not leaked due to the stream returned, one of the following
// actions must be performed:
//
//  1. Call Close on the ClientConn.
//  2. Cancel the context provided.
//  3. Call RecvMsg until a non-nil error is returned. A protobuf-generated
//     client-streaming RPC, for instance, might use the helper function
//     CloseAndRecv (note that CloseSend does not Recv, therefore is not
//     guaranteed to release all resources).
//  4. Receive a non-nil, non-io.EOF error from Header or SendMsg.
//
// If none of the above happen, a goroutine and a context will be leaked, and grpc
// will not call the optionally-configured stats handler with a stats.End message.
func (cc *ClientConn) NewStream(ctx context.Context, desc *StreamDesc, method string, opts ...CallOption) (ClientStream, error) {}

// NewClientStream is a wrapper for ClientConn.NewStream.
func NewClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (ClientStream, error) {}

func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (_ ClientStream, err error) {}

func newClientStreamWithParams(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, mc serviceconfig.MethodConfig, onCommit, doneFunc func(), opts ...CallOption) (_ iresolver.ClientStream, err error) {}

// newAttemptLocked creates a new csAttempt without a transport or stream.
func (cs *clientStream) newAttemptLocked(isTransparent bool) (*csAttempt, error) {}

func (a *csAttempt) getTransport() error {}

func (a *csAttempt) newStream() error {}

type clientStream

type csAttempt

func (cs *clientStream) commitAttemptLocked() {}

func (cs *clientStream) commitAttempt() {}

// shouldRetry returns nil if the RPC should be retried; otherwise it returns
// the error that should be returned by the operation.  If the RPC should be
// retried, the bool indicates whether it is being retried transparently.
func (a *csAttempt) shouldRetry(err error) (bool, error) {}

// Returns nil if a retry was performed and succeeded; error otherwise.
func (cs *clientStream) retryLocked(attempt *csAttempt, lastErr error) error {}

func (cs *clientStream) Context() context.Context {}

func (cs *clientStream) withRetry(op func(a *csAttempt) error, onSuccess func()) error {}

func (cs *clientStream) Header() (metadata.MD, error) {}

func (cs *clientStream) Trailer() metadata.MD {}

func (cs *clientStream) replayBufferLocked(attempt *csAttempt) error {}

func (cs *clientStream) bufferForRetryLocked(sz int, op func(a *csAttempt) error) {}

func (cs *clientStream) SendMsg(m any) (err error) {}

func (cs *clientStream) RecvMsg(m any) error {}

func (cs *clientStream) CloseSend() error {}

func (cs *clientStream) finish(err error) {}

func (a *csAttempt) sendMsg(m any, hdr, payld, data []byte) error {}

func (a *csAttempt) recvMsg(m any, payInfo *payloadInfo) (err error) {}

func (a *csAttempt) finish(err error) {}

// newClientStream creates a ClientStream with the specified transport, on the
// given addrConn.
//
// It's expected that the given transport is either the same one in addrConn, or
// is already closed. To avoid race, transport is specified separately, instead
// of using ac.transpot.
//
// Main difference between this and ClientConn.NewStream:
// - no retry
// - no service config (or wait for service config)
// - no tracing or stats
func newNonRetryClientStream(ctx context.Context, desc *StreamDesc, method string, t transport.ClientTransport, ac *addrConn, opts ...CallOption) (_ ClientStream, err error) {}

type addrConnStream

func (as *addrConnStream) Header() (metadata.MD, error) {}

func (as *addrConnStream) Trailer() metadata.MD {}

func (as *addrConnStream) CloseSend() error {}

func (as *addrConnStream) Context() context.Context {}

func (as *addrConnStream) SendMsg(m any) (err error) {}

func (as *addrConnStream) RecvMsg(m any) (err error) {}

func (as *addrConnStream) finish(err error) {}

type ServerStream

type serverStream

func (ss *serverStream) Context() context.Context {}

func (ss *serverStream) SetHeader(md metadata.MD) error {}

func (ss *serverStream) SendHeader(md metadata.MD) error {}

func (ss *serverStream) SetTrailer(md metadata.MD) {}

func (ss *serverStream) SendMsg(m any) (err error) {}

func (ss *serverStream) RecvMsg(m any) (err error) {}

// MethodFromServerStream returns the method string for the input stream.
// The returned string is in the format of "/service/method".
func MethodFromServerStream(stream ServerStream) (string, bool) {}

// prepareMsg returns the hdr, payload and data
// using the compressors passed or using the
// passed preparedmsg
func prepareMsg(m any, codec baseCodec, cp Compressor, comp encoding.Compressor) (hdr, payload, data []byte, err error) {}