repositories

package
v0.0.0-...-7c0796b Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

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

func New

func New(stor storage.Interface) *Repository

func (*Repository) AddCounter

func (r *Repository) AddCounter(ctx context.Context, name string, value int64)

func (*Repository) Clear

func (r *Repository) Clear()

func (*Repository) GetAll

func (r *Repository) GetAll(ctx context.Context) (map[string]float64, map[string]int64)

func (*Repository) GetAllCounters

func (r *Repository) GetAllCounters(ctx context.Context) map[string]int64

func (*Repository) GetAllGauges

func (r *Repository) GetAllGauges(ctx context.Context) map[string]float64

func (*Repository) GetCounter

func (r *Repository) GetCounter(ctx context.Context, name string) (int64, error)

func (*Repository) GetCounterOrZero

func (r *Repository) GetCounterOrZero(ctx context.Context, name string) int64

func (*Repository) GetGauge

func (r *Repository) GetGauge(ctx context.Context, name string) (float64, error)

func (*Repository) GetGaugeOrZero

func (r *Repository) GetGaugeOrZero(ctx context.Context, name string) float64

func (*Repository) SaveToDisk

func (r *Repository) SaveToDisk(ctx context.Context, fileStorage string) error

func (*Repository) SetGauge

func (r *Repository) SetGauge(ctx context.Context, name string, value float64)

type RepositoryInterface

type RepositoryInterface interface {
	GetAll(ctx context.Context) (map[string]float64, map[string]int64)

	GetGauge(ctx context.Context, name string) (float64, error)
	GetCounter(ctx context.Context, name string) (int64, error)

	SetGauge(ctx context.Context, name string, value float64)
	AddCounter(ctx context.Context, name string, value int64)
	SaveToDisk(ctx context.Context, fileStorage string) error
	GetAllGauges(ctx context.Context) map[string]float64
	GetAllCounters(ctx context.Context) map[string]int64
}

Jump to

Keyboard shortcuts

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