Documentation ¶
Index ¶
- func DecodeLog4(file *os.File) ([]*etcd4pb.LogEntry, error)
- func DecodeNextEntry4(r io.Reader) (*etcd4pb.LogEntry, int, error)
- func Entries4To2(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 Migrate4To2(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 MachineMessage
- type NOPCommand
- type RemoveCommand
- type SetClusterConfigCommand
- type SetCommand
- type Snapshot4
- type SnapshotFileName
- type SnapshotFileNames
- type StandbyInfo4
- type Store4
- 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 Migrate4To2 ¶
func UnixTimeOrPermanent ¶
Types ¶
type CompareAndDeleteCommand ¶
type CompareAndDeleteCommand struct { Key string `json:"key"` PrevValue string `json:"prevValue"` PrevIndex uint64 `json:"prevIndex"` }
func (*CompareAndDeleteCommand) Data2 ¶
func (c *CompareAndDeleteCommand) Data2() ([]byte, error)
func (*CompareAndDeleteCommand) Type2 ¶
func (c *CompareAndDeleteCommand) Type2() 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) Data2 ¶
func (c *CompareAndSwapCommand) Data2() ([]byte, error)
func (*CompareAndSwapCommand) Type2 ¶
func (c *CompareAndSwapCommand) Type2() 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) HardState2 ¶
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) Data2 ¶
func (c *CreateCommand) Data2() ([]byte, error)
func (*CreateCommand) Type2 ¶
func (c *CreateCommand) Type2() 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) Data2 ¶
func (c *DeleteCommand) Data2() ([]byte, error)
func (*DeleteCommand) Type2 ¶
func (c *DeleteCommand) Type2() 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) Data2 ¶
func (c *JoinCommand) Data2() ([]byte, error)
func (*JoinCommand) Type2 ¶
func (c *JoinCommand) Type2() raftpb.EntryType
type Log4 ¶
func DecodeLog4FromFile ¶
type MachineMessage ¶ added in v2.0.1
type MachineMessage struct { Name string `json:"name"` State string `json:"state"` ClientURL string `json:"clientURL"` PeerURL string `json:"peerURL"` }
MachineMessage represents information about a peer or standby in the registry.
type NOPCommand ¶
type NOPCommand struct{}
func (NOPCommand) CommandName ¶
func (c NOPCommand) CommandName() string
TODO(bcwaldon): Why is CommandName here?
func (*NOPCommand) Data2 ¶
func (c *NOPCommand) Data2() ([]byte, error)
func (*NOPCommand) Type2 ¶
func (c *NOPCommand) Type2() raftpb.EntryType
type RemoveCommand ¶
type RemoveCommand struct { Name string `json:"name"` // contains filtered or unexported fields }
func (*RemoveCommand) Data2 ¶
func (c *RemoveCommand) Data2() ([]byte, error)
func (*RemoveCommand) Type2 ¶
func (c *RemoveCommand) Type2() 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) Data2 ¶
func (c *SetClusterConfigCommand) Data2() ([]byte, error)
func (*SetClusterConfigCommand) Type2 ¶
func (c *SetClusterConfigCommand) Type2() 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) Data2 ¶
func (c *SetCommand) Data2() ([]byte, error)
func (*SetCommand) Type2 ¶
func (c *SetCommand) Type2() 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 StandbyInfo4 ¶ added in v2.0.1
type StandbyInfo4 struct { Running bool Cluster []*MachineMessage SyncInterval float64 }
func DecodeStandbyInfo4FromFile ¶ added in v2.0.1
func DecodeStandbyInfo4FromFile(path string) (*StandbyInfo4, error)
func (*StandbyInfo4) ClientURLs ¶ added in v2.0.1
func (si *StandbyInfo4) ClientURLs() []string
func (*StandbyInfo4) InitialCluster ¶ added in v2.0.1
func (si *StandbyInfo4) InitialCluster() string
type SyncCommand ¶
func (*SyncCommand) Data2 ¶
func (c *SyncCommand) Data2() ([]byte, error)
func (*SyncCommand) Type2 ¶
func (c *SyncCommand) Type2() raftpb.EntryType
type UpdateCommand ¶
type UpdateCommand struct { Key string `json:"key"` Value string `json:"value"` ExpireTime time.Time `json:"expireTime"` }
func (*UpdateCommand) Data2 ¶
func (c *UpdateCommand) Data2() ([]byte, error)
func (*UpdateCommand) Type2 ¶
func (c *UpdateCommand) Type2() raftpb.EntryType
Click to show internal directories.
Click to hide internal directories.