util

package module
v0.0.0-...-3d1347b Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: Apache-2.0 Imports: 13 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToULong

func BytesToULong(b []byte) uint64

func DeserializeMessage

func DeserializeMessage(b []byte, m proto.Message) error

func IntToBytes

func IntToBytes(num int) []byte

func LongToBytes

func LongToBytes(num int64) []byte

func Max

func Max(a int, b int) int

func NewRaftLogger

func NewRaftLogger(output io.Writer) *zerolog.Logger

func NewStdLoggerWithOutput

func NewStdLoggerWithOutput(output io.Writer) *log2.Logger

func SerializeMessage

func SerializeMessage(m proto.Message) ([]byte, error)

func ULongToBytes

func ULongToBytes(num uint64) []byte

Types

type Logger

type Logger struct {
	Writer io.Writer
	Logger zerolog.Logger
	Level  zerolog.Level
}

func CreateLogger

func CreateLogger() Logger

type Map

type Map[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func NewMap

func NewMap[K comparable, V any]() *Map[K, V]

func (*Map[K, V]) Del

func (m *Map[K, V]) Del(key K)

func (*Map[K, V]) ForEach

func (m *Map[K, V]) ForEach(f func(key K, val V) bool)

func (*Map[K, V]) Get

func (m *Map[K, V]) Get(key K) V

func (*Map[K, V]) Len

func (m *Map[K, V]) Len() int

func (*Map[K, V]) Set

func (m *Map[K, V]) Set(key K, val V)

Jump to

Keyboard shortcuts

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