Documentation ¶
Index ¶
Constants ¶
View Source
const ( FileHeaderSize = 8 + 8 // total number of messages + index of the last message RecordHeaderSize = 8 // size of the content of the message )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Appender ¶
type Appender interface { // Append writes the content of the reader to the storage medium. // and returns the index and size of the content written. Append(ctx context.Context, r io.Reader) (index int64, size int64, err error) }
Appender is a single method interface that writes the content of the reader to the storage medium.
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func (*Storage) Append ¶
Append should only be called by a single goroutine at a time. It is not safe for concurrent use.
type Stream ¶
type Stream interface { // Creates a io.Reader and provide the size of the content ahead of time. // If there is no more content to read, it will blocked until there is more content or the context is done. Next(ctx context.Context) (r *Reader, size int64, err error) // Done should be called to release the reader. // the best practice is once an stream is created successfully, call Done in defer. Done() }
Stream is an interface that deals with reading from the storage medium.
Click to show internal directories.
Click to hide internal directories.