util

package
v0.0.0-...-01e88ef Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppendEntriesRequestType string = "append_entries_request"
View Source
var AppendEntriesResponseType string = "append_entries_response"
View Source
var RequestVoteRequestType string = "request_vote_request"
View Source
var RequestVoteResponseType string = "request_vote_response"

Functions

func TLCEventMapper

func TLCEventMapper() fuzzing.TLCMapper

Types

type AppendEntriesRequest

type AppendEntriesRequest struct {
	LeaderID     int `json:"leader_id"`
	Term         int64
	PrevLogIndex int64 `json:"prev_log_idx"`
	PrevLogTerm  int64 `json:"prev_log_term"`
	LeaderCommit int64 `json:"leader_commit"`
	MessageID    int64 `json:"msg_id"`
	Entries      []Entry
}

type AppendEntriesResponse

type AppendEntriesResponse struct {
	Term         int64
	Success      int
	CurrentIndex int64 `json:"current_idx"`
	MessageID    int64 `json:"msg_id"`
}

type Entry

type Entry struct {
	Term    int64
	ID      int
	Session int64
	Type    int
	Data    string
}

type RedisRaftMessage

type RedisRaftMessage struct {
	Type                  string `json:"type"`
	AppendEntriesRequest  `json:"-"`
	AppendEntriesResponse `json:"-"`
	RequestVoteRequest    `json:"-"`
	RequestVoteResponse   `json:"-"`
}

func (RedisRaftMessage) Clone

func (RedisRaftMessage) Marshal

func (r RedisRaftMessage) Marshal() ([]byte, error)

func (RedisRaftMessage) String

func (r RedisRaftMessage) String() string

type RedisRaftMessageParser

type RedisRaftMessageParser struct{}

func (*RedisRaftMessageParser) Parse

type RequestVoteRequest

type RequestVoteRequest struct {
	Prevote      int
	Term         int64
	CandidateID  int64 `json:"candidate_id"`
	LastLogIndex int64 `json:"last_log_idx"`
	LastLogTerm  int64 `json:"last_log_term"`
}

type RequestVoteResponse

type RequestVoteResponse struct {
	Term        int64
	Prevote     int
	RequestTerm int64
	VoteGranted int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL