counter

package
v0.0.0-...-e2d3c20 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2018 License: MIT Imports: 3 Imported by: 1

Documentation

Overview

Package counter contains counter logic.

Это основная математика проекта, поэтому размещена в корне, а не в каталоге внутренних библиотек lib/.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

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

Counter holds object internals

func NewCounter

func NewCounter(s *setup.Settings, number int64) (*Counter, error)

NewCounter creates a counter object

func (*Counter) GetNumber

func (c *Counter) GetNumber() (*int64, error)

GetNumber returns current counter number

func (*Counter) GetSettings

func (c *Counter) GetSettings() (*setup.Settings, error)

GetSettings returns current settings

func (*Counter) IncrementNumber

func (c *Counter) IncrementNumber() (*int64, error)

IncrementNumber adds c.settings.Step to current counter number. If new number >= c.settings.Limit, this limit deducted from number

func (*Counter) SetSettings

func (c *Counter) SetSettings(s *setup.Settings) error

SetSettings stores new settings

Directories

Path Synopsis
Package setup contains counter settings struct only
Package setup contains counter settings struct only

Jump to

Keyboard shortcuts

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