Documentation ¶
Index ¶
- Constants
- type PayloadStream
- func (stream *PayloadStream) AsyncStreamRead() <-chan *SegmentEntry
- func (stream *PayloadStream) Close()
- func (stream *PayloadStream) InitAsyncPayloadStream(objectID uint64, rIdx uint32, segSize uint64, ...) error
- func (stream *PayloadStream) StreamClose() error
- func (stream *PayloadStream) StreamCloseWithError(err error) error
- func (stream *PayloadStream) StreamWrite(data []byte) (n int, err error)
- type SegmentEntry
Constants ¶
const StreamResultSize = 10
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PayloadStream ¶
type PayloadStream struct {
// contains filtered or unexported fields
}
PayloadStream implement a one-way data flow, writes bytes of any size read the fixed data size with payload metadata
func NewAsyncPayloadStream ¶
func NewAsyncPayloadStream() *PayloadStream
NewAsyncPayloadStream return an instance of PayloadStream, and start async read stream TODO:: implement the SyncPayloadStream in the future base on requirements
func (*PayloadStream) AsyncStreamRead ¶
func (stream *PayloadStream) AsyncStreamRead() <-chan *SegmentEntry
AsyncStreamRead return a channel that receive the payload and it's metadata
func (*PayloadStream) Close ¶
func (stream *PayloadStream) Close()
Close write and read stream by the safe way
func (*PayloadStream) InitAsyncPayloadStream ¶
func (stream *PayloadStream) InitAsyncPayloadStream(objectID uint64, rIdx uint32, segSize uint64, redundancyType storagetypes.RedundancyType) error
InitAsyncPayloadStream only be called once, init the payload metadata must be called before write or read stream
func (*PayloadStream) StreamClose ¶
func (stream *PayloadStream) StreamClose() error
StreamClose close write stream without error
func (*PayloadStream) StreamCloseWithError ¶
func (stream *PayloadStream) StreamCloseWithError(err error) error
StreamCloseWithError close write stream with error
func (*PayloadStream) StreamWrite ¶
func (stream *PayloadStream) StreamWrite(data []byte) (n int, err error)
StreamWrite writes data with the bytes of any size
type SegmentEntry ¶
type SegmentEntry struct {
// contains filtered or unexported fields
}
func (SegmentEntry) Data ¶
func (entry SegmentEntry) Data() []byte
func (SegmentEntry) Error ¶
func (entry SegmentEntry) Error() error
func (SegmentEntry) ID ¶
func (entry SegmentEntry) ID() uint64
func (SegmentEntry) Key ¶
func (entry SegmentEntry) Key() string