Documentation ¶
Index ¶
- type DBStorage
- func (strg *DBStorage) AddCounter(ctx context.Context, key string, value int64)
- func (strg *DBStorage) Clear()
- func (strg *DBStorage) CloseDB() error
- func (strg *DBStorage) GetAllCounters(ctx context.Context) map[string]int64
- func (strg *DBStorage) GetAllGauges(ctx context.Context) map[string]float64
- func (strg *DBStorage) GetCounter(ctx context.Context, name string) (int64, error)
- func (strg *DBStorage) GetCounterOrZero(ctx context.Context, name string) int64
- func (strg *DBStorage) GetDB() *DBStorage
- func (strg *DBStorage) GetGauge(ctx context.Context, name string) (float64, error)
- func (strg *DBStorage) GetGaugeOrZero(ctx context.Context, name string) float64
- func (strg *DBStorage) GetMemStorage() *MemStorage
- func (strg *DBStorage) LoadFromDisk(_ context.Context, _ string) (err error)
- func (strg *DBStorage) SaveToDisk(ctx context.Context, filename string) (err error)
- func (strg *DBStorage) SetGauge(ctx context.Context, key string, value float64)
- type Interface
- type MemStorage
- func (strg *MemStorage) AddCounter(_ context.Context, key string, value int64)
- func (strg *MemStorage) Clear()
- func (strg *MemStorage) CloseDB() error
- func (strg *MemStorage) GetAllCounters(_ context.Context) map[string]int64
- func (strg *MemStorage) GetAllGauges(_ context.Context) map[string]float64
- func (strg *MemStorage) GetCounter(ctx context.Context, name string) (int64, error)
- func (strg *MemStorage) GetCounterOrZero(_ context.Context, name string) int64
- func (strg *MemStorage) GetDB() *DBStorage
- func (strg *MemStorage) GetGauge(ctx context.Context, name string) (float64, error)
- func (strg *MemStorage) GetGaugeOrZero(_ context.Context, name string) float64
- func (strg *MemStorage) GetMemStorage() *MemStorage
- func (strg *MemStorage) LoadFromDisk(_ context.Context, filename string) (err error)
- func (strg *MemStorage) SaveToDisk(_ context.Context, filename string) (err error)
- func (strg *MemStorage) SetGauge(_ context.Context, key string, value float64)
- type SavedOnDisc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBStorage ¶
func NewDBStorage ¶
func (*DBStorage) AddCounter ¶
func (*DBStorage) GetAllCounters ¶
func (*DBStorage) GetAllGauges ¶
func (*DBStorage) GetCounter ¶
func (*DBStorage) GetCounterOrZero ¶
func (*DBStorage) GetGaugeOrZero ¶
func (*DBStorage) GetMemStorage ¶
func (strg *DBStorage) GetMemStorage() *MemStorage
func (*DBStorage) LoadFromDisk ¶
func (*DBStorage) SaveToDisk ¶
type Interface ¶
type Interface interface { Clear() AddCounter(ctx context.Context, key string, value int64) SetGauge(ctx context.Context, key string, value float64) GetGauge(ctx context.Context, name string) (float64, error) GetCounter(ctx context.Context, name string) (int64, error) GetGaugeOrZero(ctx context.Context, name string) float64 GetCounterOrZero(ctx context.Context, name string) int64 GetAllGauges(ctx context.Context) map[string]float64 GetAllCounters(ctx context.Context) map[string]int64 SaveToDisk(ctx context.Context, filename string) (err error) LoadFromDisk(ctx context.Context, filename string) (err error) GetDB() *DBStorage GetMemStorage() *MemStorage CloseDB() error }
type MemStorage ¶
type MemStorage struct { Counters map[string]int64 `json:"counters"` Gauges map[string]float64 `json:"gauges"` // contains filtered or unexported fields }
func NewRAMStorage ¶
func NewRAMStorage() *MemStorage
func (*MemStorage) AddCounter ¶
func (strg *MemStorage) AddCounter(_ context.Context, key string, value int64)
func (*MemStorage) Clear ¶
func (strg *MemStorage) Clear()
func (*MemStorage) CloseDB ¶
func (strg *MemStorage) CloseDB() error
func (*MemStorage) GetAllCounters ¶
func (strg *MemStorage) GetAllCounters(_ context.Context) map[string]int64
func (*MemStorage) GetAllGauges ¶
func (strg *MemStorage) GetAllGauges(_ context.Context) map[string]float64
func (*MemStorage) GetCounter ¶
func (*MemStorage) GetCounterOrZero ¶
func (strg *MemStorage) GetCounterOrZero(_ context.Context, name string) int64
func (*MemStorage) GetDB ¶
func (strg *MemStorage) GetDB() *DBStorage
func (*MemStorage) GetGaugeOrZero ¶
func (strg *MemStorage) GetGaugeOrZero(_ context.Context, name string) float64
func (*MemStorage) GetMemStorage ¶
func (strg *MemStorage) GetMemStorage() *MemStorage
func (*MemStorage) LoadFromDisk ¶
func (strg *MemStorage) LoadFromDisk(_ context.Context, filename string) (err error)
func (*MemStorage) SaveToDisk ¶
func (strg *MemStorage) SaveToDisk(_ context.Context, filename string) (err error)
Click to show internal directories.
Click to hide internal directories.