Documentation ¶
Overview ¶
Package db is a generated GoMock package.
Index ¶
- type Account
- type AccountTransactionsEntry
- type CreateAccountParams
- type CreateAccountStatementEntryParams
- type CreateSessionParams
- type CreateTransferEntryParams
- type CreateTransferRecordParams
- type CreateUserParams
- type CreateUserRow
- type DBTX
- type GetUserDetailsRow
- type ListAccountsParams
- type MockStore
- func (m *MockStore) CreateAccount(arg0 context.Context, arg1 CreateAccountParams) (Account, error)
- func (m *MockStore) CreateAccountStatementEntry(arg0 context.Context, arg1 CreateAccountStatementEntryParams) (AccountTransactionsEntry, error)
- func (m *MockStore) CreateTransferRecord(arg0 context.Context, arg1 CreateTransferRecordParams) (Transaction, error)
- func (m *MockStore) CreateUser(arg0 context.Context, arg1 CreateUserParams) (CreateUserRow, error)
- func (m *MockStore) DeleteAccount(arg0 context.Context, arg1 int64) error
- func (m *MockStore) EXPECT() *MockStoreMockRecorder
- func (m *MockStore) GetAccountById(arg0 context.Context, arg1 int64) (Account, error)
- func (m *MockStore) GetAccountByOwnerEmail(arg0 context.Context, arg1 string) (Account, error)
- func (m *MockStore) GetBalanceByAccountId(arg0 context.Context, arg1 int64) (int64, error)
- func (m *MockStore) GetBalanceByOwnerEmail(arg0 context.Context, arg1 string) (int64, error)
- func (m *MockStore) GetUserDetails(arg0 context.Context, arg1 string) (GetUserDetailsRow, error)
- func (m *MockStore) ListAccounts(arg0 context.Context, arg1 ListAccountsParams) ([]Account, error)
- func (m *MockStore) UpdateAccountBalanceById(arg0 context.Context, arg1 UpdateAccountBalanceByIdParams) (Account, error)
- type MockStoreMockRecorder
- func (mr *MockStoreMockRecorder) CreateAccount(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) CreateAccountStatementEntry(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) CreateTransferRecord(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) CreateUser(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) DeleteAccount(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) GetAccountById(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) GetAccountByOwnerEmail(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) GetBalanceByAccountId(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) GetBalanceByOwnerEmail(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) GetUserDetails(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) ListAccounts(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) UpdateAccountBalanceById(arg0, arg1 interface{}) *gomock.Call
- type Querier
- type Queries
- func (q *Queries) BlockSessionById(ctx context.Context, sessionID uuid.UUID) (Session, error)
- func (q *Queries) BlockSessionFamily(ctx context.Context, email string) (Session, error)
- func (q *Queries) CreateAccount(ctx context.Context, arg CreateAccountParams) (Account, error)
- func (q *Queries) CreateAccountStatementEntry(ctx context.Context, arg CreateAccountStatementEntryParams) (AccountTransactionsEntry, error)
- func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (Session, error)
- func (q *Queries) CreateTransferEntry(ctx context.Context, arg CreateTransferEntryParams) (AccountTransactionsEntry, error)
- func (q *Queries) CreateTransferRecord(ctx context.Context, arg CreateTransferRecordParams) (Transaction, error)
- func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (CreateUserRow, error)
- func (q *Queries) DeleteAccount(ctx context.Context, id int64) error
- func (q *Queries) GetAccountById(ctx context.Context, id int64) (Account, error)
- func (q *Queries) GetAccountByOwnerEmail(ctx context.Context, ownerEmail string) (Account, error)
- func (q *Queries) GetBalanceByAccountId(ctx context.Context, id int64) (int64, error)
- func (q *Queries) GetBalanceByOwnerEmail(ctx context.Context, ownerEmail string) (int64, error)
- func (q *Queries) GetSession(ctx context.Context, sessionID uuid.UUID) (Session, error)
- func (q *Queries) GetTransaction(ctx context.Context, uid uuid.UUID) (Transaction, error)
- func (q *Queries) GetTransactionsList(ctx context.Context) ([]Transaction, error)
- func (q *Queries) GetUserDetails(ctx context.Context, userEmail string) (GetUserDetailsRow, error)
- func (q *Queries) ListAccounts(ctx context.Context, arg ListAccountsParams) ([]Account, error)
- func (q *Queries) UpdateAccountBalanceById(ctx context.Context, arg UpdateAccountBalanceByIdParams) (Account, error)
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type Session
- type Transaction
- type UpdateAccountBalanceByIdParams
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountTransactionsEntry ¶
type AccountTransactionsEntry struct { Uid uuid.UUID `json:"uid"` TransactionID int64 `json:"transaction_id"` AccountID int64 `json:"account_id"` OtherAccount int64 `json:"other_account"` // must be positive Amount int64 `json:"amount"` Currency string `json:"currency"` Type string `json:"type"` CreatedAt time.Time `json:"created_at"` }
type CreateAccountParams ¶
type CreateSessionParams ¶
type CreateUserParams ¶
type CreateUserRow ¶
type GetUserDetailsRow ¶
type ListAccountsParams ¶
type MockStore ¶
type MockStore struct {
// contains filtered or unexported fields
}
MockStore is a mock of Store interface.
func NewMockStore ¶
func NewMockStore(ctrl *gomock.Controller) *MockStore
NewMockStore creates a new mock instance.
func (*MockStore) CreateAccount ¶
CreateAccount mocks base method.
func (*MockStore) CreateAccountStatementEntry ¶
func (m *MockStore) CreateAccountStatementEntry(arg0 context.Context, arg1 CreateAccountStatementEntryParams) (AccountTransactionsEntry, error)
CreateAccountStatementEntry mocks base method.
func (*MockStore) CreateTransferRecord ¶
func (m *MockStore) CreateTransferRecord(arg0 context.Context, arg1 CreateTransferRecordParams) (Transaction, error)
CreateTransferRecord mocks base method.
func (*MockStore) CreateUser ¶
func (m *MockStore) CreateUser(arg0 context.Context, arg1 CreateUserParams) (CreateUserRow, error)
CreateUser mocks base method.
func (*MockStore) DeleteAccount ¶
DeleteAccount mocks base method.
func (*MockStore) EXPECT ¶
func (m *MockStore) EXPECT() *MockStoreMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockStore) GetAccountById ¶
GetAccountById mocks base method.
func (*MockStore) GetAccountByOwnerEmail ¶
GetAccountByOwnerEmail mocks base method.
func (*MockStore) GetBalanceByAccountId ¶
GetBalanceByAccountId mocks base method.
func (*MockStore) GetBalanceByOwnerEmail ¶
GetBalanceByOwnerEmail mocks base method.
func (*MockStore) GetUserDetails ¶
GetUserDetails mocks base method.
func (*MockStore) ListAccounts ¶
ListAccounts mocks base method.
func (*MockStore) UpdateAccountBalanceById ¶
func (m *MockStore) UpdateAccountBalanceById(arg0 context.Context, arg1 UpdateAccountBalanceByIdParams) (Account, error)
UpdateAccountBalanceById mocks base method.
type MockStoreMockRecorder ¶
type MockStoreMockRecorder struct {
// contains filtered or unexported fields
}
MockStoreMockRecorder is the mock recorder for MockStore.
func (*MockStoreMockRecorder) CreateAccount ¶
func (mr *MockStoreMockRecorder) CreateAccount(arg0, arg1 interface{}) *gomock.Call
CreateAccount indicates an expected call of CreateAccount.
func (*MockStoreMockRecorder) CreateAccountStatementEntry ¶
func (mr *MockStoreMockRecorder) CreateAccountStatementEntry(arg0, arg1 interface{}) *gomock.Call
CreateAccountStatementEntry indicates an expected call of CreateAccountStatementEntry.
func (*MockStoreMockRecorder) CreateTransferRecord ¶
func (mr *MockStoreMockRecorder) CreateTransferRecord(arg0, arg1 interface{}) *gomock.Call
CreateTransferRecord indicates an expected call of CreateTransferRecord.
func (*MockStoreMockRecorder) CreateUser ¶
func (mr *MockStoreMockRecorder) CreateUser(arg0, arg1 interface{}) *gomock.Call
CreateUser indicates an expected call of CreateUser.
func (*MockStoreMockRecorder) DeleteAccount ¶
func (mr *MockStoreMockRecorder) DeleteAccount(arg0, arg1 interface{}) *gomock.Call
DeleteAccount indicates an expected call of DeleteAccount.
func (*MockStoreMockRecorder) GetAccountById ¶
func (mr *MockStoreMockRecorder) GetAccountById(arg0, arg1 interface{}) *gomock.Call
GetAccountById indicates an expected call of GetAccountById.
func (*MockStoreMockRecorder) GetAccountByOwnerEmail ¶
func (mr *MockStoreMockRecorder) GetAccountByOwnerEmail(arg0, arg1 interface{}) *gomock.Call
GetAccountByOwnerEmail indicates an expected call of GetAccountByOwnerEmail.
func (*MockStoreMockRecorder) GetBalanceByAccountId ¶
func (mr *MockStoreMockRecorder) GetBalanceByAccountId(arg0, arg1 interface{}) *gomock.Call
GetBalanceByAccountId indicates an expected call of GetBalanceByAccountId.
func (*MockStoreMockRecorder) GetBalanceByOwnerEmail ¶
func (mr *MockStoreMockRecorder) GetBalanceByOwnerEmail(arg0, arg1 interface{}) *gomock.Call
GetBalanceByOwnerEmail indicates an expected call of GetBalanceByOwnerEmail.
func (*MockStoreMockRecorder) GetUserDetails ¶
func (mr *MockStoreMockRecorder) GetUserDetails(arg0, arg1 interface{}) *gomock.Call
GetUserDetails indicates an expected call of GetUserDetails.
func (*MockStoreMockRecorder) ListAccounts ¶
func (mr *MockStoreMockRecorder) ListAccounts(arg0, arg1 interface{}) *gomock.Call
ListAccounts indicates an expected call of ListAccounts.
func (*MockStoreMockRecorder) UpdateAccountBalanceById ¶
func (mr *MockStoreMockRecorder) UpdateAccountBalanceById(arg0, arg1 interface{}) *gomock.Call
UpdateAccountBalanceById indicates an expected call of UpdateAccountBalanceById.
type Querier ¶
type Querier interface { BlockSessionById(ctx context.Context, sessionID uuid.UUID) (Session, error) BlockSessionFamily(ctx context.Context, email string) (Session, error) CreateAccount(ctx context.Context, arg CreateAccountParams) (Account, error) CreateAccountStatementEntry(ctx context.Context, arg CreateAccountStatementEntryParams) (AccountTransactionsEntry, error) CreateSession(ctx context.Context, arg CreateSessionParams) (Session, error) CreateTransferRecord(ctx context.Context, arg CreateTransferRecordParams) (Transaction, error) CreateUser(ctx context.Context, arg CreateUserParams) (CreateUserRow, error) DeleteAccount(ctx context.Context, id int64) error GetAccountById(ctx context.Context, id int64) (Account, error) GetAccountByOwnerEmail(ctx context.Context, ownerEmail string) (Account, error) GetBalanceByAccountId(ctx context.Context, id int64) (int64, error) GetBalanceByOwnerEmail(ctx context.Context, ownerEmail string) (int64, error) GetSession(ctx context.Context, sessionID uuid.UUID) (Session, error) GetTransaction(ctx context.Context, uid uuid.UUID) (Transaction, error) GetTransactionsList(ctx context.Context) ([]Transaction, error) GetUserDetails(ctx context.Context, userEmail string) (GetUserDetailsRow, error) ListAccounts(ctx context.Context, arg ListAccountsParams) ([]Account, error) UpdateAccountBalanceById(ctx context.Context, arg UpdateAccountBalanceByIdParams) (Account, error) }
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) BlockSessionById ¶
func (*Queries) BlockSessionFamily ¶
func (*Queries) CreateAccount ¶
func (*Queries) CreateAccountStatementEntry ¶
func (q *Queries) CreateAccountStatementEntry(ctx context.Context, arg CreateAccountStatementEntryParams) (AccountTransactionsEntry, error)
func (*Queries) CreateSession ¶
func (*Queries) CreateTransferEntry ¶
func (q *Queries) CreateTransferEntry(ctx context.Context, arg CreateTransferEntryParams) (AccountTransactionsEntry, error)
func (*Queries) CreateTransferRecord ¶
func (q *Queries) CreateTransferRecord(ctx context.Context, arg CreateTransferRecordParams) (Transaction, error)
func (*Queries) CreateUser ¶
func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (CreateUserRow, error)
func (*Queries) DeleteAccount ¶
func (*Queries) GetAccountById ¶
func (*Queries) GetAccountByOwnerEmail ¶
func (*Queries) GetBalanceByAccountId ¶
func (*Queries) GetBalanceByOwnerEmail ¶
func (*Queries) GetSession ¶
func (*Queries) GetTransaction ¶
func (*Queries) GetTransactionsList ¶
func (q *Queries) GetTransactionsList(ctx context.Context) ([]Transaction, error)
func (*Queries) GetUserDetails ¶
func (*Queries) ListAccounts ¶
func (*Queries) UpdateAccountBalanceById ¶
type Session ¶
type Session struct { SessionID uuid.UUID `json:"session_id"` Email string `json:"email"` UserAgent string `json:"user_agent"` ClientIp string `json:"client_ip"` RefreshToken string `json:"refresh_token"` ExpiresAt time.Time `json:"expires_at"` IsBlocked bool `json:"is_blocked"` CreatedAt time.Time `json:"created_at"` }
type Transaction ¶
type Transaction struct { Uid uuid.UUID `json:"uid"` TransactionID int64 `json:"transaction_id"` FromAccountID int64 `json:"from_account_id"` ToAccountID int64 `json:"to_account_id"` // can be negative depending on debit or credit Amount int64 `json:"amount"` Currency string `json:"currency"` CreatedAt time.Time `json:"created_at"` }