account

package
v0.0.0-...-1bf65b7 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package account provides the use-case of manipulating with user's account.

Package account provides the use-case of manipulating with user's account.

Package account provides the use-case of manipulating with user's account.

Package account provides the use-case of manipulating with user's account.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidArgument is returned when one or more arguments are invalid
	ErrInvalidArgument = errors.New("invalid argument")
	// ErrAccountNotFound is returned when one user account was not found
	ErrAccountNotFound = errors.New("account not found")
	// ErrTransferFailed is returned when transfer between accounts failed
	ErrTransferFailed = errors.New("transfer error")
)

Functions

func MakeHandler

func MakeHandler(ac Service, logger kitlog.Logger) http.Handler

MakeHandler creates http handler for manipulations with user's account

Types

type Service

type Service interface {
	Transfer(from coins.AccountID, to coins.AccountID, amount decimal.Decimal) (bool, error)
}

Service is the interface that provides account methods.

func NewLoggingService

func NewLoggingService(logger log.Logger, s Service) Service

NewLoggingService returns a new instance of a logging Service.

func NewService

func NewService(accounts coins.AccountRepository, payments coins.PaymentRepository, txs coins.TxStarter) Service

NewService returns new Service with it's dependencies

Jump to

Keyboard shortcuts

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