utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ModName = "utils"

	DefaultLoglvl    = logrus.InfoLevel
	DefaultLogOutput = os.Stdout
	DefaultFormater  = &logrus.TextFormatter{}
)

App default configurations

View Source
var SlotBase uint64 = 32

Functions

func BoolToUint

func BoolToUint(input []bool) []uint64

func GetEpochFromSlot

func GetEpochFromSlot(slot uint64) uint64

func GetValIndexesFromJson

func GetValIndexesFromJson(filePath string) ([]uint64, error)

func IsBitSet

func IsBitSet(input uint8, n int) bool

Check if bit n (0..7) is set where 0 is the LSB in little endian

func IsValidRangeuint64

func IsValidRangeuint64(init uint64, final uint64) bool

Rage utils

func ParseLogFormatter

func ParseLogFormatter(lvl string) logrus.Formatter

parse Formatter from string

func ParseLogLevel

func ParseLogLevel(lvl string) logrus.Level

Select Log Level from string

func ParseLogOutput

func ParseLogOutput(lvl string) io.Writer

parse Formatter from string

Types

type Range

type Range struct {
	// contains filtered or unexported fields
}

func NewRange

func NewRange(min int, max int) *Range

func NewRangeFromString

func NewRangeFromString(strRange string) (*Range, error)

func (*Range) GetRandomNumber

func (r *Range) GetRandomNumber() int

func (*Range) GetRandomNumberStr

func (r *Range) GetRandomNumberStr() string

Jump to

Keyboard shortcuts

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