Documentation ¶
Index ¶
- Constants
- Variables
- type FileStore
- func (s *FileStore) Clear() error
- func (s *FileStore) Close() error
- func (s *FileStore) FirstID() (uint64, error)
- func (s *FileStore) GetLog(id uint64, l *Log) error
- func (s *FileStore) LastID() (uint64, error)
- func (s *FileStore) PurgeExpired(n int64) error
- func (s *FileStore) StoreLog(l *Log) error
- func (s *FileStore) Sync() error
- type GoLevelDBStore
- func (s *GoLevelDBStore) Clear() error
- func (s *GoLevelDBStore) Close() error
- func (s *GoLevelDBStore) FirstID() (uint64, error)
- func (s *GoLevelDBStore) GetLog(id uint64, log *Log) error
- func (s *GoLevelDBStore) LastID() (uint64, error)
- func (s *GoLevelDBStore) PurgeExpired(n int64) error
- func (s *GoLevelDBStore) StoreLog(log *Log) error
- func (s *GoLevelDBStore) Sync() error
- type Log
- func (l *Log) Decode(r io.Reader) error
- func (l *Log) DecodeAt(r io.ReaderAt, pos int64) error
- func (l *Log) DecodeHead(r io.Reader) (uint32, error)
- func (l *Log) DecodeHeadAt(r io.ReaderAt, pos int64) (uint32, error)
- func (l *Log) Encode(w io.Writer) error
- func (l *Log) HeadSize() int
- func (l *Log) Marshal() ([]byte, error)
- func (l *Log) Size() int
- func (l *Log) Unmarshal(b []byte) error
- type LogStore
- type Replication
- func (r *Replication) Clear() error
- func (r *Replication) ClearWithCommitID(id uint64) error
- func (r *Replication) Close() error
- func (r *Replication) CommitIDBehind() (bool, error)
- func (r *Replication) FirstLogID() (uint64, error)
- func (r *Replication) GetLog(id uint64, log *Log) error
- func (r *Replication) LastCommitID() (uint64, error)
- func (r *Replication) LastLogID() (uint64, error)
- func (r *Replication) Log(data []byte) (*Log, error)
- func (r *Replication) NextNeedCommitLog(log *Log) error
- func (r *Replication) Stat() (*Stat, error)
- func (r *Replication) StoreLog(log *Log) error
- func (r *Replication) UpdateCommitID(id uint64) error
- func (r *Replication) WaitLog() <-chan struct{}
- type Stat
Constants ¶
View Source
const (
InvalidLogID uint64 = 0
)
View Source
const LogHeadSize = 17
Variables ¶
Functions ¶
This section is empty.
Types ¶
type FileStore ¶
type FileStore struct { LogStore // contains filtered or unexported fields }
func (*FileStore) PurgeExpired ¶
type GoLevelDBStore ¶
type GoLevelDBStore struct { LogStore // contains filtered or unexported fields }
func NewGoLevelDBStore ¶
func NewGoLevelDBStore(base string, syncLog int) (*GoLevelDBStore, error)
func (*GoLevelDBStore) Clear ¶
func (s *GoLevelDBStore) Clear() error
func (*GoLevelDBStore) Close ¶
func (s *GoLevelDBStore) Close() error
func (*GoLevelDBStore) FirstID ¶
func (s *GoLevelDBStore) FirstID() (uint64, error)
func (*GoLevelDBStore) LastID ¶
func (s *GoLevelDBStore) LastID() (uint64, error)
func (*GoLevelDBStore) PurgeExpired ¶
func (s *GoLevelDBStore) PurgeExpired(n int64) error
func (*GoLevelDBStore) StoreLog ¶
func (s *GoLevelDBStore) StoreLog(log *Log) error
func (*GoLevelDBStore) Sync ¶
func (s *GoLevelDBStore) Sync() error
type LogStore ¶
type LogStore interface { GetLog(id uint64, log *Log) error FirstID() (uint64, error) LastID() (uint64, error) // if log id is less than current last id, return error StoreLog(log *Log) error // Delete logs before n seconds PurgeExpired(n int64) error Sync() error // Clear all logs Clear() error Close() error }
type Replication ¶
type Replication struct {
// contains filtered or unexported fields
}
func NewReplication ¶
func NewReplication(cfg *config.Config) (*Replication, error)
func (*Replication) Clear ¶
func (r *Replication) Clear() error
func (*Replication) ClearWithCommitID ¶
func (r *Replication) ClearWithCommitID(id uint64) error
func (*Replication) Close ¶
func (r *Replication) Close() error
func (*Replication) CommitIDBehind ¶
func (r *Replication) CommitIDBehind() (bool, error)
func (*Replication) FirstLogID ¶
func (r *Replication) FirstLogID() (uint64, error)
func (*Replication) LastCommitID ¶
func (r *Replication) LastCommitID() (uint64, error)
func (*Replication) LastLogID ¶
func (r *Replication) LastLogID() (uint64, error)
func (*Replication) NextNeedCommitLog ¶
func (r *Replication) NextNeedCommitLog(log *Log) error
func (*Replication) Stat ¶
func (r *Replication) Stat() (*Stat, error)
func (*Replication) StoreLog ¶
func (r *Replication) StoreLog(log *Log) error
func (*Replication) UpdateCommitID ¶
func (r *Replication) UpdateCommitID(id uint64) error
func (*Replication) WaitLog ¶
func (r *Replication) WaitLog() <-chan struct{}
Click to show internal directories.
Click to hide internal directories.