byte_stream_server

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 License: MIT Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDiscardWriteCloser

func NewDiscardWriteCloser() *discardWriteCloser

Types

type ByteStreamServer

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

func NewByteStreamServer

func NewByteStreamServer(env environment.Env) (*ByteStreamServer, error)

func (*ByteStreamServer) QueryWriteStatus

`QueryWriteStatus()` is used to find the `committed_size` for a resource that is being written, which can then be used as the `write_offset` for the next `Write()` call.

If the resource does not exist (i.e., the resource has been deleted, or the first `Write()` has not yet reached the service), this method the error `NOT_FOUND`.

The client **may** call `QueryWriteStatus()` at any time to determine how much data has been processed for this resource. This is useful if the client is buffering data and needs to know which data can be safely evicted. For any sequence of `QueryWriteStatus()` calls for a given resource name, the sequence of returned `committed_size` values will be non-decreasing.

func (*ByteStreamServer) Read

`Read()` is used to retrieve the contents of a resource as a sequence of bytes. The bytes are returned in a sequence of responses, and the responses are delivered as the results of a server-side streaming FUNC (S *BYTESTREAMSERVER).

func (*ByteStreamServer) Write

type StreamWriter

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

func (*StreamWriter) Write

func (s *StreamWriter) Write(data []byte) (int, error)

Jump to

Keyboard shortcuts

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