dingo: flamingo.me/dingo/example/application Index | Files

package application

import "flamingo.me/dingo/example/application"


Package Files


type CreditCardProcessor Uses

type CreditCardProcessor interface {
    Auth(amount float64) error
    Capture(amount float64) error

CreditCardProcessor allows to auth and eventually capture an amount float64 is used as an example here

type Service Uses

type Service struct {
    // contains filtered or unexported fields

Service defines our example application service

func (*Service) Inject Uses

func (s *Service) Inject(logger TransactionLog, processor CreditCardProcessor) *Service

Inject dependencies for our service

func (*Service) MakeTransaction Uses

func (s *Service) MakeTransaction(amount float64, message string) error

MakeTransaction tries to authorize and capture an amount, and logs these steps.

type TransactionLog Uses

type TransactionLog interface {
    Log(id, message string)

TransactionLog logs information with a unique id and a message

Package application imports 3 packages (graph) and is imported by 4 packages. Updated 2019-12-19. Refresh now. Tools for package owners.