model

package
v0.0.0-...-4995c53 Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accumulator

type Accumulator struct {
	ID    string `json:"id"`
	Value uint64 `json:"value"`
}

Accumulator represents accumulator

type Repository

type Repository struct {
	Accumulators map[string]uint64
}

Repository stores accumulators

func NewRepository

func NewRepository() Repository

NewRepository creates new empty repository

func (Repository) DeleteAccumulator

func (repository Repository) DeleteAccumulator(accumulator Accumulator)

DeleteAccumulator deletes specified accumulator

func (Repository) GetAccumulator

func (repository Repository) GetAccumulator(id string) Accumulator

GetAccumulator returns accumulator with specified id

func (Repository) NewAccumulator

func (repository Repository) NewAccumulator() Accumulator

NewAccumulator creates new accumulator and adds it to the repository

func (Repository) UpdateAccumulator

func (repository Repository) UpdateAccumulator(accumulator Accumulator)

UpdateAccumulator updates specified accumulator

Jump to

Keyboard shortcuts

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