interfaces

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KiloByte             = 1024
	MegaByte             = 1024 * KiloByte
	DefaultCapacityBytes = 1 * MegaByte
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Hashrate

type Hashrate interface {
	GetTotalWork() float64
	GetTotalDuration() time.Duration
	GetLastSubmitTime() time.Time
	GetHashrate5minGHS() float64
	GetHashrateTotalGHS() float64
	GetHashrateCustomGHS(duration time.Duration) (float64, bool)
	GetDurationHashrateGHSMap() map[time.Duration]float64
}

type ILogger

type ILogger interface {
	Debug(args ...interface{})
	Info(args ...interface{})
	Warn(args ...interface{})
	Error(args ...interface{})
	DPanic(args ...interface{}) // Development panic - panics only in development mode
	Panic(args ...interface{})
	Fatal(args ...interface{})

	Debugf(template string, args ...interface{})
	Infof(template string, args ...interface{})
	Warnf(template string, args ...interface{})
	Errorf(template string, args ...interface{})
	DPanicf(template string, args ...interface{})
	Panicf(template string, args ...interface{})
	Fatalf(template string, args ...interface{})

	Debugw(msg string, keysAndValues ...interface{})
	Infow(msg string, keysAndValues ...interface{})
	Warnw(msg string, keysAndValues ...interface{})
	Errorw(msg string, keysAndValues ...interface{})
	DPanicw(msg string, keysAndValues ...interface{})
	Panicw(msg string, keysAndValues ...interface{})
	Fatalw(msg string, keysAndValues ...interface{})

	Log(lvl zapcore.Level, msg string, fields ...zapcore.Field)

	Sync() error
	Close() error
	Named(name string) ILogger
	With(args ...interface{}) ILogger
}

type LogStorage

type LogStorage struct {
	Buffer MyBuf
	// contains filtered or unexported fields
}

func NewLogStorage

func NewLogStorage(ID string) *LogStorage

func NewLogStorageWithCapacity

func NewLogStorageWithCapacity(ID string, capBytes uint64) *LogStorage

func (*LogStorage) GetReader

func (l *LogStorage) GetReader() io.Reader

func (*LogStorage) ID

func (l *LogStorage) ID() string

type MyBuf

type MyBuf interface {
	io.Writer
	NewReader() io.Reader
	Capacity() uint64
}

func NewMyBuf

func NewMyBuf(cap uint64) MyBuf

Jump to

Keyboard shortcuts

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