Documentation ¶
Index ¶
- func DecodeLog4(file *os.File) ([]*etcd4pb.LogEntry, error)
- func DecodeNextEntry4(r io.Reader) (*etcd4pb.LogEntry, int, error)
- func Entries4To5(ents4 []*etcd4pb.LogEntry) ([]raftpb.Entry, error)
- func FindLatestFile(dirpath string) (string, error)
- func GuessNodeID(nodes map[string]uint64, snap4 *Snapshot4, cfg *Config4, name string) uint64
- func Migrate4To5(dataDir string, name string) error
- func NewMember(name string, peerURLs types.URLs, clusterName string) *member
- func StorePath(key string) string
- func UnixTimeOrPermanent(expireTime time.Time) int64
- type Command4
- type CompareAndDeleteCommand
- type CompareAndSwapCommand
- type Config4
- type CreateCommand
- type DefaultJoinCommand
- type DefaultLeaveCommand
- type DeleteCommand
- type JoinCommand
- type Log4
- type NOPCommand
- type RemoveCommand
- type SetClusterConfigCommand
- type SetCommand
- type Snapshot4
- type SnapshotFileName
- type SnapshotFileNames
- type SyncCommand
- type UpdateCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeNextEntry4 ¶
DecodeNextEntry4 unmarshals a v0.4 log entry from a reader. Returns the number of bytes read and any error that occurs.
func FindLatestFile ¶
FindLatestFile identifies the "latest" filename in a given directory by sorting all the files and choosing the highest value.
func GuessNodeID ¶
func Migrate4To5 ¶
func UnixTimeOrPermanent ¶
Types ¶
type CompareAndDeleteCommand ¶
type CompareAndDeleteCommand struct { Key string `json:"key"` PrevValue string `json:"prevValue"` PrevIndex uint64 `json:"prevIndex"` }
func (*CompareAndDeleteCommand) Data5 ¶
func (c *CompareAndDeleteCommand) Data5() ([]byte, error)
func (*CompareAndDeleteCommand) Type5 ¶
func (c *CompareAndDeleteCommand) Type5() raftpb.EntryType
type CompareAndSwapCommand ¶
type CompareAndSwapCommand struct { Key string `json:"key"` Value string `json:"value"` ExpireTime time.Time `json:"expireTime"` PrevValue string `json:"prevValue"` PrevIndex uint64 `json:"prevIndex"` }
func (*CompareAndSwapCommand) Data5 ¶
func (c *CompareAndSwapCommand) Data5() ([]byte, error)
func (*CompareAndSwapCommand) Type5 ¶
func (c *CompareAndSwapCommand) Type5() raftpb.EntryType
type Config4 ¶
type Config4 struct { CommitIndex uint64 `json:"commitIndex"` Peers []struct { Name string `json:"name"` ConnectionString string `json:"connectionString"` } `json:"peers"` }
func DecodeConfig4FromFile ¶
func (*Config4) HardState5 ¶
type CreateCommand ¶
type CreateCommand struct { Key string `json:"key"` Value string `json:"value"` ExpireTime time.Time `json:"expireTime"` Unique bool `json:"unique"` Dir bool `json:"dir"` }
func (*CreateCommand) Data5 ¶
func (c *CreateCommand) Data5() ([]byte, error)
func (*CreateCommand) Type5 ¶
func (c *CreateCommand) Type5() raftpb.EntryType
type DefaultJoinCommand ¶
type DefaultLeaveCommand ¶
type DefaultLeaveCommand struct { Name string `json:"name"` // contains filtered or unexported fields }
type DeleteCommand ¶
type DeleteCommand struct { Key string `json:"key"` Recursive bool `json:"recursive"` Dir bool `json:"dir"` }
func (*DeleteCommand) Data5 ¶
func (c *DeleteCommand) Data5() ([]byte, error)
func (*DeleteCommand) Type5 ¶
func (c *DeleteCommand) Type5() raftpb.EntryType
type JoinCommand ¶
type JoinCommand struct { Name string `json:"name"` RaftURL string `json:"raftURL"` EtcdURL string `json:"etcdURL"` // contains filtered or unexported fields }
func (*JoinCommand) Data5 ¶
func (c *JoinCommand) Data5() ([]byte, error)
func (*JoinCommand) Type5 ¶
func (c *JoinCommand) Type5() raftpb.EntryType
type Log4 ¶
func DecodeLog4FromFile ¶
type NOPCommand ¶
type NOPCommand struct{}
func (NOPCommand) CommandName ¶
func (c NOPCommand) CommandName() string
TODO(bcwaldon): Why is CommandName here?
func (*NOPCommand) Data5 ¶
func (c *NOPCommand) Data5() ([]byte, error)
func (*NOPCommand) Type5 ¶
func (c *NOPCommand) Type5() raftpb.EntryType
type RemoveCommand ¶
type RemoveCommand struct { Name string `json:"name"` // contains filtered or unexported fields }
func (*RemoveCommand) Data5 ¶
func (c *RemoveCommand) Data5() ([]byte, error)
func (*RemoveCommand) Type5 ¶
func (c *RemoveCommand) Type5() raftpb.EntryType
type SetClusterConfigCommand ¶
type SetClusterConfigCommand struct { Config *struct { ActiveSize int `json:"activeSize"` RemoveDelay float64 `json:"removeDelay"` SyncInterval float64 `json:"syncInterval"` } `json:"config"` }
func (*SetClusterConfigCommand) Data5 ¶
func (c *SetClusterConfigCommand) Data5() ([]byte, error)
func (*SetClusterConfigCommand) Type5 ¶
func (c *SetClusterConfigCommand) Type5() raftpb.EntryType
type SetCommand ¶
type SetCommand struct { Key string `json:"key"` Value string `json:"value"` ExpireTime time.Time `json:"expireTime"` Dir bool `json:"dir"` }
func (*SetCommand) Data5 ¶
func (c *SetCommand) Data5() ([]byte, error)
func (*SetCommand) Type5 ¶
func (c *SetCommand) Type5() raftpb.EntryType
type Snapshot4 ¶
type Snapshot4 struct { State []byte `json:"state"` LastIndex uint64 `json:"lastIndex"` LastTerm uint64 `json:"lastTerm"` Peers []struct { Name string `json:"name"` ConnectionString string `json:"connectionString"` } `json:"peers"` }
func DecodeSnapshot4FromFile ¶
func (*Snapshot4) GetNodesFromStore ¶
type SnapshotFileName ¶
func NewSnapshotFileNames ¶
func NewSnapshotFileNames(names []string) ([]SnapshotFileName, error)
type SnapshotFileNames ¶
type SnapshotFileNames []SnapshotFileName
func (*SnapshotFileNames) Len ¶
func (n *SnapshotFileNames) Len() int
func (*SnapshotFileNames) Less ¶
func (n *SnapshotFileNames) Less(i, j int) bool
func (*SnapshotFileNames) Swap ¶
func (n *SnapshotFileNames) Swap(i, j int)
type SyncCommand ¶
func (*SyncCommand) Data5 ¶
func (c *SyncCommand) Data5() ([]byte, error)
func (*SyncCommand) Type5 ¶
func (c *SyncCommand) Type5() raftpb.EntryType
type UpdateCommand ¶
type UpdateCommand struct { Key string `json:"key"` Value string `json:"value"` ExpireTime time.Time `json:"expireTime"` }
func (*UpdateCommand) Data5 ¶
func (c *UpdateCommand) Data5() ([]byte, error)
func (*UpdateCommand) Type5 ¶
func (c *UpdateCommand) Type5() raftpb.EntryType
Click to show internal directories.
Click to hide internal directories.