Documentation
¶
Index ¶
- type CategoryType
- type CreateOAuthUserParams
- type CreatePaymentParams
- type CreateUserParams
- type CreateUserTokenParams
- type DBTX
- type DeleteByUserAndPurposeParams
- type FrequencyType
- type GetAllPaymentsParams
- type GetAllUsersParams
- type GetTokenByHashParams
- type NullCategoryType
- type NullFrequencyType
- type NullTokenPurpose
- type NullTransactionType
- type NullUserRole
- type Payment
- type Querier
- type Queries
- func (q *Queries) CreateOAuthUser(ctx context.Context, arg CreateOAuthUserParams) (User, error)
- func (q *Queries) CreatePayment(ctx context.Context, arg CreatePaymentParams) (Payment, error)
- func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
- func (q *Queries) CreateUserToken(ctx context.Context, arg CreateUserTokenParams) (UserToken, error)
- func (q *Queries) DeleteByUserAndPurpose(ctx context.Context, arg DeleteByUserAndPurposeParams) error
- func (q *Queries) DeleteOldTokens(ctx context.Context) (int64, error)
- func (q *Queries) DeletePayment(ctx context.Context, id int32) (int64, error)
- func (q *Queries) DeleteUser(ctx context.Context, id int32) (int64, error)
- func (q *Queries) GetAllPayments(ctx context.Context, arg GetAllPaymentsParams) ([]Payment, error)
- func (q *Queries) GetAllUsers(ctx context.Context, arg GetAllUsersParams) ([]User, error)
- func (q *Queries) GetMyPayments(ctx context.Context, userID int32) ([]Payment, error)
- func (q *Queries) GetPaymentByID(ctx context.Context, id int32) (Payment, error)
- func (q *Queries) GetTokenByHash(ctx context.Context, arg GetTokenByHashParams) (UserToken, error)
- func (q *Queries) GetUserByEmail(ctx context.Context, email string) (User, error)
- func (q *Queries) GetUserByGoogleID(ctx context.Context, googleID pgtype.Text) (User, error)
- func (q *Queries) GetUserByID(ctx context.Context, id int32) (User, error)
- func (q *Queries) UpdatePayment(ctx context.Context, arg UpdatePaymentParams) (int64, error)
- func (q *Queries) UpdateUserGoogleID(ctx context.Context, arg UpdateUserGoogleIDParams) (int64, error)
- func (q *Queries) UpdateUserIsActiveReturning(ctx context.Context, arg UpdateUserIsActiveReturningParams) (User, error)
- func (q *Queries) UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) (int64, error)
- func (q *Queries) UpdateUserProfile(ctx context.Context, arg UpdateUserProfileParams) (int64, error)
- func (q *Queries) VerifyAndConsumeToken(ctx context.Context, arg VerifyAndConsumeTokenParams) (UserToken, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type TokenPurpose
- type TransactionType
- type UpdatePaymentParams
- type UpdateUserGoogleIDParams
- type UpdateUserIsActiveReturningParams
- type UpdateUserPasswordParams
- type UpdateUserProfileParams
- type User
- type UserRole
- type UserToken
- type VerifyAndConsumeTokenParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CategoryType ¶
type CategoryType string
const ( CategoryTypeElectronics CategoryType = "electronics" CategoryTypeEntertainment CategoryType = "entertainment" CategoryTypeEducation CategoryType = "education" CategoryTypeClothing CategoryType = "clothing" CategoryTypeWork CategoryType = "work" CategoryTypeSports CategoryType = "sports" )
func (*CategoryType) Scan ¶
func (e *CategoryType) Scan(src interface{}) error
type CreateOAuthUserParams ¶
type CreatePaymentParams ¶
type CreatePaymentParams struct {
UserID int32 `json:"user_id"`
Name string `json:"name"`
Amount pgtype.Numeric `json:"amount"`
Type TransactionType `json:"type"`
Category CategoryType `json:"category"`
Date string `json:"date"`
DueDate pgtype.Text `json:"due_date"`
Paid bool `json:"paid"`
PaidAt pgtype.Text `json:"paid_at"`
Recurrent bool `json:"recurrent"`
Frequency NullFrequencyType `json:"frequency"`
ReceiptUrl pgtype.Text `json:"receipt_url"`
}
type CreateUserParams ¶
type CreateUserTokenParams ¶
type CreateUserTokenParams struct {
UserID int32 `json:"user_id"`
TokenHash string `json:"token_hash"`
Purpose TokenPurpose `json:"purpose"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
}
type DeleteByUserAndPurposeParams ¶
type DeleteByUserAndPurposeParams struct {
UserID int32 `json:"user_id"`
Purpose TokenPurpose `json:"purpose"`
}
type FrequencyType ¶
type FrequencyType string
const ( FrequencyTypeDaily FrequencyType = "daily" FrequencyTypeWeekly FrequencyType = "weekly" FrequencyTypeMonthly FrequencyType = "monthly" FrequencyTypeYearly FrequencyType = "yearly" )
func (*FrequencyType) Scan ¶
func (e *FrequencyType) Scan(src interface{}) error
type GetAllPaymentsParams ¶
type GetAllUsersParams ¶
type GetTokenByHashParams ¶
type GetTokenByHashParams struct {
TokenHash string `json:"token_hash"`
Purpose TokenPurpose `json:"purpose"`
}
type NullCategoryType ¶
type NullCategoryType struct {
CategoryType CategoryType `json:"category_type"`
Valid bool `json:"valid"` // Valid is true if CategoryType is not NULL
}
func (*NullCategoryType) Scan ¶
func (ns *NullCategoryType) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullFrequencyType ¶
type NullFrequencyType struct {
FrequencyType FrequencyType `json:"frequency_type"`
Valid bool `json:"valid"` // Valid is true if FrequencyType is not NULL
}
func (*NullFrequencyType) Scan ¶
func (ns *NullFrequencyType) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullTokenPurpose ¶
type NullTokenPurpose struct {
TokenPurpose TokenPurpose `json:"token_purpose"`
Valid bool `json:"valid"` // Valid is true if TokenPurpose is not NULL
}
func (*NullTokenPurpose) Scan ¶
func (ns *NullTokenPurpose) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullTransactionType ¶
type NullTransactionType struct {
TransactionType TransactionType `json:"transaction_type"`
Valid bool `json:"valid"` // Valid is true if TransactionType is not NULL
}
func (*NullTransactionType) Scan ¶
func (ns *NullTransactionType) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullUserRole ¶
type NullUserRole struct {
UserRole UserRole `json:"user_role"`
Valid bool `json:"valid"` // Valid is true if UserRole is not NULL
}
func (*NullUserRole) Scan ¶
func (ns *NullUserRole) Scan(value interface{}) error
Scan implements the Scanner interface.
type Payment ¶
type Payment struct {
ID int32 `json:"id"`
UserID int32 `json:"user_id"`
Name string `json:"name"`
Amount pgtype.Numeric `json:"amount"`
Type TransactionType `json:"type"`
Category CategoryType `json:"category"`
Date string `json:"date"`
DueDate pgtype.Text `json:"due_date"`
Paid bool `json:"paid"`
PaidAt pgtype.Text `json:"paid_at"`
Recurrent bool `json:"recurrent"`
Frequency NullFrequencyType `json:"frequency"`
ReceiptUrl pgtype.Text `json:"receipt_url"`
}
type Querier ¶
type Querier interface {
CreateOAuthUser(ctx context.Context, arg CreateOAuthUserParams) (User, error)
CreatePayment(ctx context.Context, arg CreatePaymentParams) (Payment, error)
CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
CreateUserToken(ctx context.Context, arg CreateUserTokenParams) (UserToken, error)
DeleteByUserAndPurpose(ctx context.Context, arg DeleteByUserAndPurposeParams) error
DeleteOldTokens(ctx context.Context) (int64, error)
DeletePayment(ctx context.Context, id int32) (int64, error)
DeleteUser(ctx context.Context, id int32) (int64, error)
GetAllPayments(ctx context.Context, arg GetAllPaymentsParams) ([]Payment, error)
GetAllUsers(ctx context.Context, arg GetAllUsersParams) ([]User, error)
GetMyPayments(ctx context.Context, userID int32) ([]Payment, error)
GetPaymentByID(ctx context.Context, id int32) (Payment, error)
GetTokenByHash(ctx context.Context, arg GetTokenByHashParams) (UserToken, error)
GetUserByEmail(ctx context.Context, email string) (User, error)
GetUserByGoogleID(ctx context.Context, googleID pgtype.Text) (User, error)
GetUserByID(ctx context.Context, id int32) (User, error)
UpdatePayment(ctx context.Context, arg UpdatePaymentParams) (int64, error)
UpdateUserGoogleID(ctx context.Context, arg UpdateUserGoogleIDParams) (int64, error)
UpdateUserIsActiveReturning(ctx context.Context, arg UpdateUserIsActiveReturningParams) (User, error)
UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) (int64, error)
UpdateUserProfile(ctx context.Context, arg UpdateUserProfileParams) (int64, error)
VerifyAndConsumeToken(ctx context.Context, arg VerifyAndConsumeTokenParams) (UserToken, error)
}
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CreateOAuthUser ¶
func (*Queries) CreatePayment ¶
func (*Queries) CreateUser ¶
func (*Queries) CreateUserToken ¶
func (*Queries) DeleteByUserAndPurpose ¶
func (q *Queries) DeleteByUserAndPurpose(ctx context.Context, arg DeleteByUserAndPurposeParams) error
func (*Queries) DeleteOldTokens ¶
func (*Queries) DeletePayment ¶
func (*Queries) DeleteUser ¶
func (*Queries) GetAllPayments ¶
func (*Queries) GetAllUsers ¶
func (*Queries) GetMyPayments ¶
func (*Queries) GetPaymentByID ¶
func (*Queries) GetTokenByHash ¶
func (*Queries) GetUserByEmail ¶
func (*Queries) GetUserByGoogleID ¶
func (*Queries) GetUserByID ¶
func (*Queries) UpdatePayment ¶
func (*Queries) UpdateUserGoogleID ¶
func (*Queries) UpdateUserIsActiveReturning ¶
func (*Queries) UpdateUserPassword ¶
func (*Queries) UpdateUserProfile ¶
func (*Queries) VerifyAndConsumeToken ¶
type TokenPurpose ¶
type TokenPurpose string
const ( TokenPurposeEmailVerification TokenPurpose = "email_verification" TokenPurposePasswordReset TokenPurpose = "password_reset" )
func (*TokenPurpose) Scan ¶
func (e *TokenPurpose) Scan(src interface{}) error
type TransactionType ¶
type TransactionType string
const ( TransactionTypeExpense TransactionType = "expense" TransactionTypeIncome TransactionType = "income" TransactionTypeSubscription TransactionType = "subscription" )
func (*TransactionType) Scan ¶
func (e *TransactionType) Scan(src interface{}) error
type UpdatePaymentParams ¶
type UpdatePaymentParams struct {
ID int32 `json:"id"`
Name string `json:"name"`
Amount pgtype.Numeric `json:"amount"`
Type TransactionType `json:"type"`
Category CategoryType `json:"category"`
Date string `json:"date"`
DueDate pgtype.Text `json:"due_date"`
Paid bool `json:"paid"`
PaidAt pgtype.Text `json:"paid_at"`
Recurrent bool `json:"recurrent"`
Frequency NullFrequencyType `json:"frequency"`
ReceiptUrl pgtype.Text `json:"receipt_url"`
}
type UpdateUserProfileParams ¶
type User ¶
type User struct {
ID int32 `json:"id"`
Username string `json:"username"`
Email string `json:"email"`
PasswordHash pgtype.Text `json:"password_hash"`
Name pgtype.Text `json:"name"`
Role UserRole `json:"role"`
GoogleID pgtype.Text `json:"google_id"`
IsActive bool `json:"is_active"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type UserToken ¶
type UserToken struct {
ID int32 `json:"id"`
UserID int32 `json:"user_id"`
TokenHash string `json:"token_hash"`
Purpose TokenPurpose `json:"purpose"`
Used bool `json:"used"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type VerifyAndConsumeTokenParams ¶
type VerifyAndConsumeTokenParams struct {
TokenHash string `json:"token_hash"`
Purpose TokenPurpose `json:"purpose"`
}
Click to show internal directories.
Click to hide internal directories.