payment

package
v0.0.0-...-bffa35e Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package payments provides the use-case of history of accounts payments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeHandler

func MakeHandler(bs Service, logger log.Logger) http.Handler

MakeHandler returns a handler for the account service.

func NewLoggerService

func NewLoggerService(logger log.Logger, s Service) *loggerService

NewLoggerService returns a new instance of the Service with logging.

Types

type Direction

type Direction string

Direction describes type of a payment event.

const (
	DirectionIn  Direction = "incoming"
	DirectionOut Direction = "outgoing"
)

Valid directions.

type Endpoints

type Endpoints struct {
	Get endpoint.Endpoint
}

Endpoints holds all Go kit endpoints for the Payments service.

type Payment

type Payment struct {
	ID        int             `json:"id"`
	Account   string          `json:"account"`
	Amount    decimal.Decimal `json:"amount"`
	ToAccount string          `json:"to_account"`
	Direction Direction       `json:"direction"`
}

Payment is the handling history of accounts payments.

type Service

type Service interface {
	// Get - returns a list of all payments.
	Get() ([]*Payment, error)
}

Service is the interface that provides the basic Payment method.

func NewService

func NewService(payments coins.PaymentRepository) Service

NewService returns a new instance of the default Service.

Jump to

Keyboard shortcuts

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