Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { ID AccountID Name string CPF CPF Secret string Balance Money CreatedAt time.Time }
Account represents a bank account.
func NewAccount ¶
NewAccount returns a new Account filled with the corresponding arguments with generated values for id and createdAt.
func (*Account) CompareSecrets ¶
CompareSecrets compare account secret and payload.
func (*Account) HashSecret ¶
HashSecret hashes secret with bcrypt.
type AccountID ¶
type AccountID string
AccountID represents an Account ID as uuid.
func NewAccountID ¶
func NewAccountID() AccountID
NewAccountID returns a new AccountID with value generated by uuid.New().
type CPF ¶
type CPF string
CPF represents the Brazilian taxpayer ID, know as CPF.
type Money ¶
type Money int64
Money represents monetary amount. It is an integer to prevent floating point math problems.
type Transfer ¶
type Transfer struct { ID TransferID AccountOriginID AccountID AccountDestinationID AccountID Amount Money CreatedAt time.Time }
Transfer represents a bank transfer between two accounts.
func NewTransfer ¶
NewTransfer returns a new Transfer filled with the corresponding arguments with generated values for id and createdAt.
type TransferID ¶
type TransferID string
TransferID represents a Transfer ID as uuid
func NewTransferID ¶
func NewTransferID() TransferID
NewTransferID returns a new TransferID with value generated by uuid.New()