Documentation ¶
Index ¶
- type Config
- type CounterService
- func (s *CounterService) Close()
- func (s *CounterService) GetNumber(ctx context.Context, in *empty.Empty) (*pb.Number, error)
- func (s *CounterService) GetSettings(ctx context.Context, in *empty.Empty) (*pb.Settings, error)
- func (s *CounterService) IncrementNumber(ctx context.Context, in *empty.Empty) (*empty.Empty, error)
- func (s *CounterService) SetSettings(ctx context.Context, in *pb.Settings) (*empty.Empty, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Number int64 `long:"init_number" default:"0" description:"Initial number"` Step int64 `long:"init_step" default:"1" description:"Increment step"` Limit int64 `long:"init_limit" default:"100" description:"Increment loop limit"` StrictStoreErrors bool `long:"store_strict" description:"Do not ignore store errors"` }
Config is a program flags group used in constructor
type CounterService ¶
type CounterService struct {
// contains filtered or unexported fields
}
CounterService holds object internals
func (*CounterService) Close ¶
func (s *CounterService) Close()
Close logs final values as warning and closes store.
func (*CounterService) GetSettings ¶
GetSettings reads settings from counter
func (*CounterService) IncrementNumber ¶
func (s *CounterService) IncrementNumber(ctx context.Context, in *empty.Empty) (*empty.Empty, error)
IncrementNumber increments counter and stores new number in database
func (*CounterService) SetSettings ¶
SetSettings sets settings to counter and stores them in database
Click to show internal directories.
Click to hide internal directories.