bank

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateService

func CreateService(nc *nats.Conn, s Service, opts *Options) (micro.Service, error)

Types

type Account

type Account struct {
	ID uuid.UUID
	// contains filtered or unexported fields
}

type Deposit

type Deposit struct {
	ID    uuid.UUID
	Funds int
}

type Funds

type Funds struct {
	CurrencyCode string
	Total        int
}

type Hold

type Hold struct {
	ID    uuid.UUID
	Funds int
}

type Options

type Options struct {
	micro.Config
	Name    string
	Version string

	BankCode    string
	CountryCode string
}

type Service

type Service interface {
	NewAccount(r micro.Request, ownerID uuid.UUID)
	Account(r micro.Request, ownerID uuid.UUID, accountID uuid.UUID)
	Accounts(r micro.Request, ownerID uuid.UUID)
	Deposit(r micro.Request, deposit Deposit)
	Transfer(r micro.Request, transfer Transfer)
	Hold(r micro.Request, hold Hold)
}

type ServiceWrapper

type ServiceWrapper struct {
	Handler Service
}

func (*ServiceWrapper) Account

func (s *ServiceWrapper) Account(r micro.Request)

func (*ServiceWrapper) Accounts

func (s *ServiceWrapper) Accounts(r micro.Request)

func (*ServiceWrapper) Deposit

func (s *ServiceWrapper) Deposit(r micro.Request)

func (*ServiceWrapper) Hold

func (s *ServiceWrapper) Hold(r micro.Request)

func (*ServiceWrapper) NewAccount

func (s *ServiceWrapper) NewAccount(r micro.Request)

func (*ServiceWrapper) Transfer

func (s *ServiceWrapper) Transfer(r micro.Request)

type TestEnum

type TestEnum string

TestEnum This is a desciprtion about this enum

const (
	Hello   TestEnum = "Hello"
	Gootbye TestEnum = "Gootbye"
)

type Transfer

type Transfer struct {
	ID    uuid.UUID
	Funds int
}

Jump to

Keyboard shortcuts

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