Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BankService ¶
func GetBankServiceSingleton ¶
func GetBankServiceSingleton() (*BankService, error)
func InitBankService ¶
func InitBankService(b *BankService) (*BankService, error)
func (*BankService) AddMoney ¶
func (b *BankService) AddMoney(id, num int) error
func (*BankService) AddMoneyRollback ¶
func (b *BankService) AddMoneyRollback(id, num int, errMsg string)
func (*BankService) GetMoney ¶
func (b *BankService) GetMoney(id int) int
func (*BankService) RemoveMoney ¶
func (b *BankService) RemoveMoney(id, num int) error
func (*BankService) RemoveMoneyRollback ¶
func (b *BankService) RemoveMoneyRollback(id, num int, errMsg string)
type BankServiceConstructFunc ¶
type BankServiceConstructFunc func(impl *BankService) (*BankService, error)
type BankServiceIOCInterface ¶
type BankServiceIOCInterface interface { GetMoney(id int) int AddMoney(id, num int) error AddMoneyRollback(id, num int, errMsg string) RemoveMoney(id, num int) error RemoveMoneyRollback(id, num int, errMsg string) }
func GetBankServiceIOCInterfaceSingleton ¶
func GetBankServiceIOCInterfaceSingleton() (BankServiceIOCInterface, error)
type ThisBankService ¶
type ThisBankService struct { }
func (*ThisBankService) This ¶
func (t *ThisBankService) This() BankServiceIOCInterface
type ThisTradeService ¶
type ThisTradeService struct { }
func (*ThisTradeService) This ¶
func (t *ThisTradeService) This() TradeServiceIOCInterface
type TradeService ¶
type TradeService struct {
BankService BankServiceIOCInterface `singleton:""`
}
func GetTradeServiceSingleton ¶
func GetTradeServiceSingleton() (*TradeService, error)
func (*TradeService) DoTradeWithTxAddMoneyFailed ¶
func (b *TradeService) DoTradeWithTxAddMoneyFailed(id1, id2, num int) error
func (*TradeService) DoTradeWithTxFinallyFailed ¶
func (b *TradeService) DoTradeWithTxFinallyFailed(id1, id2, num int) error
func (*TradeService) DoTradeWithTxSuccess ¶
func (b *TradeService) DoTradeWithTxSuccess(id1, id2, num int) error
type TradeServiceIOCInterface ¶
type TradeServiceIOCInterface interface { DoTradeWithTxAddMoneyFailed(id1, id2, num int) error DoTradeWithTxFinallyFailed(id1, id2, num int) error DoTradeWithTxSuccess(id1, id2, num int) error }
func GetTradeServiceIOCInterfaceSingleton ¶
func GetTradeServiceIOCInterfaceSingleton() (TradeServiceIOCInterface, error)
Click to show internal directories.
Click to hide internal directories.