Documentation ¶
Index ¶
- Constants
- type Config
- type DistributedLog
- func (l *DistributedLog) Append(record *api.Record) (uint64, error)
- func (l *DistributedLog) Close() error
- func (l *DistributedLog) GetServers() ([]*api.Server, error)
- func (l *DistributedLog) Join(id, addr string) error
- func (l *DistributedLog) Leave(id string) error
- func (l *DistributedLog) Read(offset uint64) (*api.Record, error)
- func (l *DistributedLog) WaitForLeader(timeout time.Duration) error
- type Log
- func (l *Log) Append(record *api.Record) (uint64, error)
- func (l *Log) Close() error
- func (l *Log) HighestOffset() (uint64, error)
- func (l *Log) LowestOffset() (uint64, error)
- func (l *Log) Read(off uint64) (*api.Record, error)
- func (l *Log) Reader() io.Reader
- func (l *Log) Remove() error
- func (l *Log) Reset() error
- func (l *Log) Truncate(lowest uint64) error
- type RequestType
- type StreamLayer
Constants ¶
View Source
const RaftRPC = 1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DistributedLog ¶
type DistributedLog struct {
// contains filtered or unexported fields
}
func NewDistributedLog ¶
func NewDistributedLog(dataDir string, config Config) ( *DistributedLog, error, )
func (*DistributedLog) Close ¶
func (l *DistributedLog) Close() error
func (*DistributedLog) GetServers ¶
func (l *DistributedLog) GetServers() ([]*api.Server, error)
func (*DistributedLog) Join ¶
func (l *DistributedLog) Join(id, addr string) error
func (*DistributedLog) Leave ¶
func (l *DistributedLog) Leave(id string) error
func (*DistributedLog) WaitForLeader ¶
func (l *DistributedLog) WaitForLeader(timeout time.Duration) error
type StreamLayer ¶
type StreamLayer struct {
// contains filtered or unexported fields
}
func NewStreamLayer ¶
func NewStreamLayer( ln net.Listener, serverTLSConfig, peerTLSConfig *tls.Config, ) *StreamLayer
func (*StreamLayer) Addr ¶
func (s *StreamLayer) Addr() net.Addr
func (*StreamLayer) Close ¶
func (s *StreamLayer) Close() error
func (*StreamLayer) Dial ¶
func (s *StreamLayer) Dial( addr raft.ServerAddress, timeout time.Duration, ) (net.Conn, error)
Click to show internal directories.
Click to hide internal directories.