Documentation ¶
Index ¶
Constants ¶
View Source
const ( RedisAccountStatus = "account:status:%s" RedisDefaultExp = 24 * 7 * time.Hour )
View Source
const ( ResponseStatusSuccess = "success" ResponseStatusFail = "fail" )
View Source
const ( TransactionTypeDeposit = "deposit" TransactionTypeWithdrawal = "withdrawal" )
View Source
const ( TransactionStatusSuccess = "success" TransactionStatusFailed = "failed" )
Variables ¶
View Source
var ( // Generic errors ErrBadRequest = errors.New("Bad request") ErrNotFound = errors.New("Not found") ErrUnprocessableEntity = errors.New("Unprocessable entity") ErrInternal = errors.New("Internal error") // Specific errors ErrAccountAlreadyExists = errors.New("Account already exists") ErrAccountAlreadyEnabled = errors.New("Account already enabled") ErrAccountAlreadyDisabled = errors.New("Account already disabled") ErrAccountDisabled = errors.New("Account disabled") ErrDuplicateReferenceID = errors.New("Duplicate reference ID") ErrInsufficientBalance = errors.New("Insufficient balance") )
Known errors
View Source
var ( MapErrorToStatusCode = map[error]int{ ErrBadRequest: 400, ErrUnauthorized: 401, ErrNotFound: 404, ErrUnprocessableEntity: 422, ErrInternal: 500, ErrAccountAlreadyExists: 400, ErrAccountAlreadyEnabled: 400, ErrAccountAlreadyDisabled: 400, ErrAccountDisabled: 400, ErrDuplicateReferenceID: 400, ErrInsufficientBalance: 400, } )
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.