grpc_chunkio

package module
v0.0.0-...-9aa7a30 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

README

Build Status Documentation

grpc-chunkio

Go Reader/Writer interface which enabled chunked transfer of data over a gRPC stream

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthChunk = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowChunk   = fmt.Errorf("proto: integer overflow")
)

Functions

func NewReader

func NewReader(readStream ChunkReadStream) io.ReadCloser

func NewWriter

func NewWriter(responseStream ChunkWriteStream, packetSize int) io.WriteCloser

NewWriter returns a WriteCloser which will send data over the gRPC Stream

Types

type Chunk

type Chunk struct {
	Data                 []byte   `protobuf:"bytes,1,opt,name=Data,proto3" json:"Data,omitempty"`
	Error                string   `protobuf:"bytes,2,opt,name=Error,proto3" json:"Error,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Chunk) Descriptor

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

func (*Chunk) GetData

func (m *Chunk) GetData() []byte

func (*Chunk) GetError

func (m *Chunk) GetError() string

func (*Chunk) Marshal

func (m *Chunk) Marshal() (dAtA []byte, err error)

func (*Chunk) MarshalTo

func (m *Chunk) MarshalTo(dAtA []byte) (int, error)

func (*Chunk) ProtoMessage

func (*Chunk) ProtoMessage()

func (*Chunk) Reset

func (m *Chunk) Reset()

func (*Chunk) Size

func (m *Chunk) Size() (n int)

func (*Chunk) String

func (m *Chunk) String() string

func (*Chunk) Unmarshal

func (m *Chunk) Unmarshal(dAtA []byte) error

func (*Chunk) XXX_DiscardUnknown

func (m *Chunk) XXX_DiscardUnknown()

func (*Chunk) XXX_Marshal

func (m *Chunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Chunk) XXX_Merge

func (dst *Chunk) XXX_Merge(src proto.Message)

func (*Chunk) XXX_Size

func (m *Chunk) XXX_Size() int

func (*Chunk) XXX_Unmarshal

func (m *Chunk) XXX_Unmarshal(b []byte) error

type ChunkReadStream

type ChunkReadStream interface {
	Recv() (*Chunk, error)
}

type ChunkWriteStream

type ChunkWriteStream interface {
	Send(*Chunk) error
}

ChunkWriteStream represents a gRPC stream which can send Chunks

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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