handler

package
Version: v0.0.0-...-a64fb18 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountCreator

type AccountCreator interface {
	Create(string) (*domain.Account, error)
}

AccountCreator defines the behaviour about how to create an account

type AccountFinder

type AccountFinder interface {
	Find(*domain.ID) (*domain.Account, error)
}

AccountFinder defines the behaviour about how to find an account

type CreateAccount

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

CreateAccount contains the dependencies to create an account

func NewCreateAccount

func NewCreateAccount(logger *log.Logger, accountCreator AccountCreator) *CreateAccount

NewCreateAccount creates a new CreateAccount struct with its dependencies

func (CreateAccount) Handler

func (h CreateAccount) Handler(rw http.ResponseWriter, req *http.Request)

Handler exposes the http handler

type CreateTransaction

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

CreateTransaction contains the dependencies to create a transaction

func NewCreateTransaction

func NewCreateTransaction(logger *log.Logger, transactionCreator TransactionCreator) *CreateTransaction

NewCreateTransaction creates a new CreateTransaction struct with its dependencies

func (CreateTransaction) Handler

func (h CreateTransaction) Handler(rw http.ResponseWriter, req *http.Request)

Handler exposes the http handler

type FindAccount

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

FindAccount contains the dependencies to find an account

func NewFindAccount

func NewFindAccount(logger *log.Logger, accountFinder AccountFinder) *FindAccount

NewFindAccount creates a new FindAccount struct

func (FindAccount) Handler

func (f FindAccount) Handler(rw http.ResponseWriter, req *http.Request)

Handler exposes the http handler

type TransactionCreator

type TransactionCreator interface {
	Create(*domain.ID, *domain.ID, float64) (*domain.Transaction, error)
}

TransactionCreator defines the behaviour about how to create a transaction

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL