aggservice

package
v0.0.0-...-336f265 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: GPL-3.0 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(_ context.Context, dist types.Distance) error

func (*BasicService) Calculate

func (svc *BasicService) Calculate(_ context.Context, obuID int) (*types.Invoice, error)

type MemoryStore

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

func NewMemoryStore

func NewMemoryStore() *MemoryStore

func (*MemoryStore) Get

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

func (*MemoryStore) Insert

func (m *MemoryStore) Insert(d types.Distance) error

type Middleware

type Middleware func(Service) Service

type Service

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

func New

func New(logger log.Logger) Service

New will construct a complete microservice

type Storer

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

Jump to

Keyboard shortcuts

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