Documentation ¶
Index ¶
- type Repository
- func (r *Repository) AddCounter(ctx context.Context, name string, value int64)
- func (r *Repository) Clear()
- func (r *Repository) GetAll(ctx context.Context) (map[string]float64, map[string]int64)
- func (r *Repository) GetAllCounters(ctx context.Context) map[string]int64
- func (r *Repository) GetAllGauges(ctx context.Context) map[string]float64
- func (r *Repository) GetCounter(ctx context.Context, name string) (int64, error)
- func (r *Repository) GetCounterOrZero(ctx context.Context, name string) int64
- func (r *Repository) GetGauge(ctx context.Context, name string) (float64, error)
- func (r *Repository) GetGaugeOrZero(ctx context.Context, name string) float64
- func (r *Repository) SaveToDisk(ctx context.Context, fileStorage string) error
- func (r *Repository) SetGauge(ctx context.Context, name string, value float64)
- type RepositoryInterface
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) 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 (*Repository) GetCounterOrZero ¶
func (r *Repository) GetCounterOrZero(ctx context.Context, name string) int64
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
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 }
Click to show internal directories.
Click to hide internal directories.