kubernetes/vendor/go.etcd.io/etcd/raft/v3/util.go

func (st StateType) MarshalJSON() ([]byte, error) {}

func min(a, b uint64) uint64 {}

func max(a, b uint64) uint64 {}

func IsLocalMsg(msgt pb.MessageType) bool {}

func IsResponseMsg(msgt pb.MessageType) bool {}

// voteResponseType maps vote and prevote message types to their corresponding responses.
func voteRespMsgType(msgt pb.MessageType) pb.MessageType {}

func DescribeHardState(hs pb.HardState) string {}

func DescribeSoftState(ss SoftState) string {}

func DescribeConfState(state pb.ConfState) string {}

func DescribeSnapshot(snap pb.Snapshot) string {}

func DescribeReady(rd Ready, f EntryFormatter) string {}

type EntryFormatter

// DescribeMessage returns a concise human-readable description of a
// Message for debugging.
func DescribeMessage(m pb.Message, f EntryFormatter) string {}

// PayloadSize is the size of the payload of this Entry. Notably, it does not
// depend on its Index or Term.
func PayloadSize(e pb.Entry) int {}

// DescribeEntry returns a concise human-readable description of an
// Entry for debugging.
func DescribeEntry(e pb.Entry, f EntryFormatter) string {}

// DescribeEntries calls DescribeEntry for each Entry, adding a newline to
// each.
func DescribeEntries(ents []pb.Entry, f EntryFormatter) string {}

func limitSize(ents []pb.Entry, maxSize uint64) []pb.Entry {}

func assertConfStatesEquivalent(l Logger, cs1, cs2 pb.ConfState) {}