Documentation ¶
Index ¶
- Constants
- Variables
- func InitTopic(conf *topicConfiguration) *topicUnit
- func NewDefaultConfig() *topicConfiguration
- type Client
- type Reader
- func (r Reader) AutoReset(br bool)
- func (r Reader) Commit() error
- func (r Reader) CurrentEnd() *readerPos
- func (r Reader) Position() uint64
- func (r Reader) ReadBatch() ([]interface{}, error)
- func (r Reader) ReadFullBatch() ([]interface{}, error)
- func (r Reader) ReadOne() (interface{}, error)
- func (r Reader) Reset()
- func (r Reader) Rollback() error
- func (r Reader) TransactionReadBatch() []interface{}
- func (r Reader) TransactionReadOne() interface{}
- type Topic
- type TopicWatcher
- func (t TopicWatcher) Clients() *clientReg
- func (t TopicWatcher) CurrentPos() uint64
- func (t TopicWatcher) DoPurge(passed uint64)
- func (w TopicWatcher) GetStart() *readerPos
- func (w TopicWatcher) GetTail() *readerPos
- func (t TopicWatcher) ReleaseWaiting()
- func (t TopicWatcher) Write(i interface{}) error
Constants ¶
View Source
const ( ReadPos_Empty = iota ReadPos_Default ReadPos_Latest )
View Source
const ( ReadPos_Resume = 256 + iota ReadPos_ResumeOrDefault ReadPos_ResumeOrLatest )
Variables ¶
View Source
var ErrDropOut = fmt.Errorf("Client have been dropped out")
View Source
var ErrEOF = fmt.Errorf("EOF")
Functions ¶
func NewDefaultConfig ¶
func NewDefaultConfig() *topicConfiguration
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func (Reader) CurrentEnd ¶
func (r Reader) CurrentEnd() *readerPos
func (Reader) ReadFullBatch ¶
func (r Reader) ReadFullBatch() ([]interface{}, error)
try to read full batch (at least one more item has been written after current batch) this method will locked and the only way to quit is calling the ReleaseWaiting in topic
func (Reader) TransactionReadBatch ¶
func (r Reader) TransactionReadBatch() []interface{}
func (Reader) TransactionReadOne ¶
func (r Reader) TransactionReadOne() interface{}
type Topic ¶
type Topic struct {
// contains filtered or unexported fields
}
func CreateTopic ¶
func CreateTopic(conf *topicConfiguration) Topic
func (Topic) CurrentPos ¶
func (t Topic) CurrentPos() uint64
func (Topic) ReleaseWaiting ¶
func (t Topic) ReleaseWaiting()
func (Topic) Watcher ¶
func (t Topic) Watcher() TopicWatcher
type TopicWatcher ¶
type TopicWatcher struct {
// contains filtered or unexported fields
}
obtain a topic wather, access some members without locking
func (TopicWatcher) CurrentPos ¶
func (t TopicWatcher) CurrentPos() uint64
func (TopicWatcher) GetStart ¶
func (w TopicWatcher) GetStart() *readerPos
func (TopicWatcher) GetTail ¶
func (w TopicWatcher) GetTail() *readerPos
func (TopicWatcher) ReleaseWaiting ¶
func (t TopicWatcher) ReleaseWaiting()
Click to show internal directories.
Click to hide internal directories.