aggservice

package
v0.0.0-...-268bfc8 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicService

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

func (*BasicService) Aggregate

func (svc *BasicService) Aggregate(ctx context.Context, distance types.Distance) error

func (*BasicService) Calculate

func (svc *BasicService) Calculate(ctx context.Context, id int) (*types.Invoice, error)

type MemoryStore

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

func NewMemoryStore

func NewMemoryStore() *MemoryStore

func (*MemoryStore) Get

func (s *MemoryStore) Get(id int) (float64, error)

func (*MemoryStore) Insert

func (s *MemoryStore) Insert(distance types.Distance) error

type Middleware

type Middleware func(Service) Service

type Service

type Service interface {
	Aggregate(ctx context.Context, distance types.Distance) error
	Calculate(ctx context.Context, id int) (*types.Invoice, error)
}

func New

func New(logger log.Logger) Service

New returns a naive, stateless implementation of Service.

type Storer

type Storer interface {
	Insert(distance types.Distance) error
	Get(id int) (float64, error)
}

Jump to

Keyboard shortcuts

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