Documentation ¶
Index ¶
- Variables
- func GetFilterCriteria(filter filters.CardTransactionFilter) (string, []interface{})
- type CardTransaction
- type Contact
- type DataLayer
- type JsonNullTime
- type Model
- type PersistenceDataLayer
- func (p *PersistenceDataLayer) CreateCardTransaction(cardTransaction *CardTransaction) (int64, error)
- func (p *PersistenceDataLayer) CreateContact(name, phone string, userID int64) (int64, error)
- func (p *PersistenceDataLayer) CreateSignUpConfirmation(nonce string, userID int64) (int64, error)
- func (p *PersistenceDataLayer) CreateUser(email, password string) (int64, error)
- func (p *PersistenceDataLayer) GetCardTransactionByID(id int64) (*CardTransaction, error)
- func (p *PersistenceDataLayer) GetCardTransactionsByUserID(userID int64, sortable pagination.Sortable, ...) ([]*CardTransaction, error)
- func (p *PersistenceDataLayer) GetConn() *sqlx.DB
- func (p *PersistenceDataLayer) GetContactByID(id int64) (*Contact, error)
- func (p *PersistenceDataLayer) GetContactsByUserID(userID int64) ([]*Contact, error)
- func (p *PersistenceDataLayer) GetUnconfirmedUsers() ([]User, error)
- func (p *PersistenceDataLayer) GetUserByEmail(email string) (*User, error)
- func (p *PersistenceDataLayer) GetUserByID(id int64) (*User, error)
- func (p *PersistenceDataLayer) LookupSignUpConfirmation(nonce string) (*SignUpConfirmation, error)
- func (p *PersistenceDataLayer) SetUserStateByID(id int64, state UserState) error
- type SignUpConfirmation
- type User
- type UserState
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoData = sql.ErrNoRows
)
Functions ¶
func GetFilterCriteria ¶
func GetFilterCriteria(filter filters.CardTransactionFilter) (string, []interface{})
Types ¶
type CardTransaction ¶
type CardTransaction struct { Model DateTime time.Time `json:"dateTime" db:"datetime"` Amount int64 `json:"amount" db:"amount"` CurrencyScale int `json:"scale" db:"currency_scale"` CurrencyCode string `json:"currencyCode" db:"currency_code"` Reference string `json:"reference" db:"reference"` MerchantName string `json:"merchantName" db:"merchant_name"` MerchantCity string `json:"merchantCity" db:"merchant_city"` MerchantCountryCode string `json:"merchantCountryCode" db:"merchant_country_code"` MerchantCountryName string `json:"merchantCountryName" db:"merchant_country_name"` MerchantCategoryCode string `json:"merchantCategoryCode" db:"merchant_category_code"` MerchantCategoryName string `json:"merchantCategoryName" db:"merchant_category_name"` UserID int64 `json:"userID" db:"user_id"` }
type DataLayer ¶
type DataLayer interface { // Users GetUserByEmail(email string) (*User, error) GetUserByID(id int64) (*User, error) CreateUser(email, password string) (int64, error) GetUnconfirmedUsers() ([]User, error) SetUserStateByID(id int64, state UserState) error // Contacts CreateContact(name, phone string, userID int64) (int64, error) GetContactByID(id int64) (*Contact, error) GetContactsByUserID(userID int64) ([]*Contact, error) // Transactions CreateCardTransaction(*CardTransaction) (int64, error) GetCardTransactionByID(id int64) (*CardTransaction, error) GetCardTransactionsByUserID(userID int64, sortable pagination.Sortable, filter filters.CardTransactionFilter) ([]*CardTransaction, error) // SignUpConfirmations CreateSignUpConfirmation(nonce string, userID int64) (int64, error) LookupSignUpConfirmation(nonce string) (*SignUpConfirmation, error) }
type JsonNullTime ¶
func (JsonNullTime) MarshalJSON ¶
func (v JsonNullTime) MarshalJSON() ([]byte, error)
func (*JsonNullTime) UnmarshalJSON ¶
func (v *JsonNullTime) UnmarshalJSON(data []byte) error
type Model ¶
type Model struct { ID int64 `json:"id" db:"id"` CreatedAt JsonNullTime `json:"createdAt" db:"created_at"` UpdatedAt JsonNullTime `json:"updatedAt" db:"updated_at"` DeletedAt JsonNullTime `json:"deletedAt" db:"deleted_at"` }
type PersistenceDataLayer ¶
type PersistenceDataLayer struct {
// contains filtered or unexported fields
}
func New ¶
func New() (*PersistenceDataLayer, error)
func (*PersistenceDataLayer) CreateCardTransaction ¶
func (p *PersistenceDataLayer) CreateCardTransaction(cardTransaction *CardTransaction) (int64, error)
func (*PersistenceDataLayer) CreateContact ¶
func (p *PersistenceDataLayer) CreateContact(name, phone string, userID int64) (int64, error)
func (*PersistenceDataLayer) CreateSignUpConfirmation ¶
func (p *PersistenceDataLayer) CreateSignUpConfirmation(nonce string, userID int64) (int64, error)
func (*PersistenceDataLayer) CreateUser ¶
func (p *PersistenceDataLayer) CreateUser(email, password string) (int64, error)
func (*PersistenceDataLayer) GetCardTransactionByID ¶
func (p *PersistenceDataLayer) GetCardTransactionByID(id int64) (*CardTransaction, error)
func (*PersistenceDataLayer) GetCardTransactionsByUserID ¶
func (p *PersistenceDataLayer) GetCardTransactionsByUserID(userID int64, sortable pagination.Sortable, filter filters.CardTransactionFilter) ([]*CardTransaction, error)
func (*PersistenceDataLayer) GetConn ¶
func (p *PersistenceDataLayer) GetConn() *sqlx.DB
func (*PersistenceDataLayer) GetContactByID ¶
func (p *PersistenceDataLayer) GetContactByID(id int64) (*Contact, error)
func (*PersistenceDataLayer) GetContactsByUserID ¶
func (p *PersistenceDataLayer) GetContactsByUserID(userID int64) ([]*Contact, error)
func (*PersistenceDataLayer) GetUnconfirmedUsers ¶
func (p *PersistenceDataLayer) GetUnconfirmedUsers() ([]User, error)
func (*PersistenceDataLayer) GetUserByEmail ¶
func (p *PersistenceDataLayer) GetUserByEmail(email string) (*User, error)
func (*PersistenceDataLayer) GetUserByID ¶
func (p *PersistenceDataLayer) GetUserByID(id int64) (*User, error)
func (*PersistenceDataLayer) LookupSignUpConfirmation ¶
func (p *PersistenceDataLayer) LookupSignUpConfirmation(nonce string) (*SignUpConfirmation, error)
func (*PersistenceDataLayer) SetUserStateByID ¶
func (p *PersistenceDataLayer) SetUserStateByID(id int64, state UserState) error
type SignUpConfirmation ¶
type User ¶
type User struct { Model Email sql.NullString `db:"email"` Password sql.NullString `db:"password"` Role sql.NullString `db:"role"` State sql.NullString `db:"state"` LoggedOutAt JsonNullTime `db:"logged_out_at"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.