counter

package
v0.0.0-...-4eb6e80 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCounterRepository

func NewCounterRepository(client *redis.Client) *couterRepository

Types

type Counter

type Counter interface {
	Set(ctx context.Context, num uint64) error
	Get(ctx context.Context) (string, error)
}

type CounterService

type CounterService interface {
	Get(ctx context.Context) (string, error)
	SetIncrement(ctx context.Context, num string) error
	SetDecrement(ctx context.Context, num string) error
}

type Service

type Service struct {
	Repository Counter
}

func NewService

func NewService(client *redis.Client) *Service

func (*Service) Get

func (s *Service) Get(ctx context.Context) (string, error)

func (*Service) SetDecrement

func (s *Service) SetDecrement(ctx context.Context, num string) error

func (*Service) SetIncrement

func (s *Service) SetIncrement(ctx context.Context, num string) error

Directories

Path Synopsis
delivery
Package mock_counter is a generated GoMock package.
Package mock_counter is a generated GoMock package.

Jump to

Keyboard shortcuts

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