Versions in this module Expand all Collapse all v1 v1.0.1 May 24, 2020 v1.0.0 May 24, 2020 Changes in this version + const Gibibyte + const Kibibyte + const Mebibyte + const Tebibyte + func ErrorCallerStackHandler(maxLvl log15.Lvl, handler log15.Handler) log15.Handler + func ErrorWithCategory(category error, cause error) error + func FloatToRational(floatVal float64) *big.Rat + func HasErrorCategory(err error, category error) bool + func NopOpenedCallback(*os.File, bool) error + func ParseRational(str string) (*big.Rat, error) + func RationalDiv(num, denom *big.Rat) *big.Rat + func RationalToFloat(val *big.Rat) float64 + func RotatingLog(file string, level string) (log15.Logger, error) + func StderrLog() log15.Logger + func UnwrapCauseFromErrorCategory(err error, category error) error + type Byte int64 + func MaxBytes(x, y Byte) Byte + func MinBytes(x, y Byte) Byte + func (b *Byte) UnmarshalJSON(data []byte) error + func (b Byte) Bytes() int64 + func (b Byte) Gibibytes() float64 + func (b Byte) Kibibytes() float64 + func (b Byte) MarshalJSON() ([]byte, error) + func (b Byte) Mebibytes() float64 + func (b Byte) Tebibytes() float64 + type Duration time.Duration + func MaxDuration(x, y Duration) Duration + func MinDuration(x, y Duration) Duration + func (d *Duration) UnmarshalJSON(data []byte) error + func (d Duration) MarshalJSON() ([]byte, error) + func (d Duration) Milliseconds() float64 + func (d Duration) Seconds() float64 + func (d Duration) String() string + type LRUCache struct + func NewLRUCache(sizeLimit Byte) *LRUCache + func (c *LRUCache) EntryCount() int + func (c *LRUCache) EvictableSize() Byte + func (c *LRUCache) Get(key string, factory SizedEntryFactory) (*SizedEntryRef, error) + func (c *LRUCache) OvercommittedSize() Byte + func (c *LRUCache) Put(r *SizedEntryRef) + func (c *LRUCache) Size() Byte + type Metrics interface + CounterAdd func(name string, value float64) + GaugeAdd func(name string, value float64) + SummaryObserve func(name string, value float64) + type NoOpMetrics struct + func (n *NoOpMetrics) CounterAdd(name string, value float64) + func (n *NoOpMetrics) GaugeAdd(name string, value float64) + func (n *NoOpMetrics) SummaryObserve(name string, value float64) + type OpenedCallback func(f *os.File, isEmpty bool) error + type RotatingFile struct + func NewRotatingFile(path string, mode os.FileMode, callback OpenedCallback) (*RotatingFile, error) + func (r *RotatingFile) Close() error + func (r *RotatingFile) Rotate() error + func (r *RotatingFile) Write(b []byte) (int, error) + func (r *RotatingFile) WriteString(s string) (int, error) + type SizedEntry interface + Release func() + Size func() Byte + type SizedEntryFactory func(key string) (SizedEntry, error) + type SizedEntryRef struct + Value SizedEntry Other modules containing this package github.com/omegaup/go-base/v2 github.com/omegaup/go-base/v3