Documentation
¶
Overview ¶
Package entities contains generated code for schema 'point_app'.
Index ¶
- func Errorf(s string, v ...interface{})
- func Logf(s string, v ...interface{})
- func SetErrorLogger(logger interface{})
- func SetLogger(logger interface{})
- type DB
- type DeleteUser
- func (du *DeleteUser) Delete(ctx context.Context, db DB) error
- func (du *DeleteUser) Deleted() bool
- func (du *DeleteUser) Exists() bool
- func (du *DeleteUser) Insert(ctx context.Context, db DB) error
- func (du *DeleteUser) Save(ctx context.Context, db DB) error
- func (du *DeleteUser) Update(ctx context.Context, db DB) error
- func (du *DeleteUser) Upsert(ctx context.Context, db DB) error
- type ErrInsertFailed
- type ErrUpdateFailed
- type ErrUpsertFailed
- type Error
- type Notification
- func NotificationByID(ctx context.Context, db DB, id uint64) (*Notification, error)
- func NotificationsByNotificationTypeID(ctx context.Context, db DB, notificationTypeID uint64) ([]*Notification, error)
- func NotificationsByToUserIDID(ctx context.Context, db DB, toUserID, id uint64) ([]*Notification, error)
- func (n *Notification) Delete(ctx context.Context, db DB) error
- func (n *Notification) Deleted() bool
- func (n *Notification) Exists() bool
- func (n *Notification) Insert(ctx context.Context, db DB) error
- func (n *Notification) NotificationType(ctx context.Context, db DB) (*NotificationType, error)
- func (n *Notification) Save(ctx context.Context, db DB) error
- func (n *Notification) Update(ctx context.Context, db DB) error
- func (n *Notification) Upsert(ctx context.Context, db DB) error
- type NotificationType
- func (nt *NotificationType) Delete(ctx context.Context, db DB) error
- func (nt *NotificationType) Deleted() bool
- func (nt *NotificationType) Exists() bool
- func (nt *NotificationType) Insert(ctx context.Context, db DB) error
- func (nt *NotificationType) Save(ctx context.Context, db DB) error
- func (nt *NotificationType) Update(ctx context.Context, db DB) error
- func (nt *NotificationType) Upsert(ctx context.Context, db DB) error
- type Transaction
- func (t *Transaction) Delete(ctx context.Context, db DB) error
- func (t *Transaction) Deleted() bool
- func (t *Transaction) Exists() bool
- func (t *Transaction) Insert(ctx context.Context, db DB) error
- func (t *Transaction) Save(ctx context.Context, db DB) error
- func (t *Transaction) Update(ctx context.Context, db DB) error
- func (t *Transaction) Upsert(ctx context.Context, db DB) error
- type User
- func (u *User) Delete(ctx context.Context, db DB) error
- func (u *User) Deleted() bool
- func (u *User) Exists() bool
- func (u *User) Insert(ctx context.Context, db DB) error
- func (u *User) Save(ctx context.Context, db DB) error
- func (u *User) Update(ctx context.Context, db DB) error
- func (u *User) Upsert(ctx context.Context, db DB) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Errorf ¶
func Errorf(s string, v ...interface{})
Errorf logs an error message using the package error logger.
func SetErrorLogger ¶
func SetErrorLogger(logger interface{})
SetErrorLogger sets the package error logger. Valid logger types:
io.Writer
func(string, ...interface{}) (int, error) // fmt.Printf
func(string, ...interface{}) // log.Printf
Types ¶
type DB ¶
type DB interface {
ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}
DB is the common interface for database operations that can be used with types from schema 'point_app'.
This works with both database/sql.DB and database/sql.Tx.
type DeleteUser ¶
type DeleteUser struct {
ID uint64 `json:"id" db:"id"` // ユーザーの識別子
NotificationLatestID uint64 `json:"notification_latest_id" db:"notification_latest_id"` // 最新のお知らせID
FamilyName string `json:"family_name" db:"family_name"` // 苗字
FamilyNameKana string `json:"family_name_kana" db:"family_name_kana"` // 苗字カナ
FirstName string `json:"first_name" db:"first_name"` // 名前
FirstNameKana string `json:"first_name_kana" db:"first_name_kana"` // 名前カナ
Email string `json:"email" db:"email"` // メールアドレス
Password string `json:"password" db:"password"` // パスワードハッシュ
SendingPoint int `json:"sending_point" db:"sending_point"` // 送信可能ポイント
CreatedAt time.Time `json:"created_at" db:"created_at"` // レコード作成日時
UpdateAt time.Time `json:"update_at" db:"update_at"` // レコード修正日時
DeleteAt time.Time `json:"delete_at" db:"delete_at"` // レコード削除日時
// contains filtered or unexported fields
}
DeleteUser represents a row from 'point_app.delete_users'.
func DeleteUserByEmail ¶
DeleteUserByEmail retrieves a row from 'point_app.delete_users' as a DeleteUser.
Generated from index 'uix_email'.
func DeleteUserByID ¶
DeleteUserByID retrieves a row from 'point_app.delete_users' as a DeleteUser.
Generated from index 'delete_users_id_pkey'.
func (*DeleteUser) Delete ¶
func (du *DeleteUser) Delete(ctx context.Context, db DB) error
Delete deletes the DeleteUser from the database.
func (*DeleteUser) Deleted ¶
func (du *DeleteUser) Deleted() bool
Deleted returns true when the DeleteUser has been marked for deletion from the database.
func (*DeleteUser) Exists ¶
func (du *DeleteUser) Exists() bool
Exists returns true when the DeleteUser exists in the database.
func (*DeleteUser) Insert ¶
func (du *DeleteUser) Insert(ctx context.Context, db DB) error
Insert inserts the DeleteUser to the database.
func (*DeleteUser) Save ¶
func (du *DeleteUser) Save(ctx context.Context, db DB) error
Save saves the DeleteUser to the database.
func (*DeleteUser) Update ¶
func (du *DeleteUser) Update(ctx context.Context, db DB) error
Update updates a DeleteUser in the database.
func (*DeleteUser) Upsert ¶
func (du *DeleteUser) Upsert(ctx context.Context, db DB) error
Upsert performs an upsert for DeleteUser.
type ErrInsertFailed ¶
type ErrInsertFailed struct {
Err error
}
ErrInsertFailed is the insert failed error.
func (*ErrInsertFailed) Error ¶
func (err *ErrInsertFailed) Error() string
Error satisfies the error interface.
func (*ErrInsertFailed) Unwrap ¶
func (err *ErrInsertFailed) Unwrap() error
Unwrap satisfies the unwrap interface.
type ErrUpdateFailed ¶
type ErrUpdateFailed struct {
Err error
}
ErrUpdateFailed is the update failed error.
func (*ErrUpdateFailed) Error ¶
func (err *ErrUpdateFailed) Error() string
Error satisfies the error interface.
func (*ErrUpdateFailed) Unwrap ¶
func (err *ErrUpdateFailed) Unwrap() error
Unwrap satisfies the unwrap interface.
type ErrUpsertFailed ¶
type ErrUpsertFailed struct {
Err error
}
ErrUpsertFailed is the upsert failed error.
func (*ErrUpsertFailed) Error ¶
func (err *ErrUpsertFailed) Error() string
Error satisfies the error interface.
func (*ErrUpsertFailed) Unwrap ¶
func (err *ErrUpsertFailed) Unwrap() error
Unwrap satisfies the unwrap interface.
type Error ¶
type Error string
Error is an error.
const ( // ErrAlreadyExists is the already exists error. ErrAlreadyExists Error = "already exists" // ErrDoesNotExist is the does not exist error. ErrDoesNotExist Error = "does not exist" // ErrMarkedForDeletion is the marked for deletion error. ErrMarkedForDeletion Error = "marked for deletion" )
Error values.
type Notification ¶
type Notification struct {
ID uint64 `json:"id" db:"id"` // お知らせID
ToUserID uint64 `json:"to_user_id" db:"to_user_id"` // お知らせ先ユーザID
FromUserID uint64 `json:"from_user_id" db:"from_user_id"` // お知らせ元ユーザID
IsChecked bool `json:"is_checked" db:"is_checked"` // チェックフラグ
NotificationTypeID uint64 `json:"notification_type_id" db:"notification_type_id"` // お知らせ種別ID
Description string `json:"description" db:"description"` // 説明
CreatedAt time.Time `json:"created_at" db:"created_at"` // 作成日時
// contains filtered or unexported fields
}
Notification represents a row from 'point_app.notifications'.
func NotificationByID ¶
NotificationByID retrieves a row from 'point_app.notifications' as a Notification.
Generated from index 'notifications_id_pkey'.
func NotificationsByNotificationTypeID ¶
func NotificationsByNotificationTypeID(ctx context.Context, db DB, notificationTypeID uint64) ([]*Notification, error)
NotificationsByNotificationTypeID retrieves a row from 'point_app.notifications' as a Notification.
Generated from index 'fk_notification_type_id'.
func NotificationsByToUserIDID ¶
func NotificationsByToUserIDID(ctx context.Context, db DB, toUserID, id uint64) ([]*Notification, error)
NotificationsByToUserIDID retrieves a row from 'point_app.notifications' as a Notification.
Generated from index 'idx_to_user_id'.
func (*Notification) Delete ¶
func (n *Notification) Delete(ctx context.Context, db DB) error
Delete deletes the Notification from the database.
func (*Notification) Deleted ¶
func (n *Notification) Deleted() bool
Deleted returns true when the Notification has been marked for deletion from the database.
func (*Notification) Exists ¶
func (n *Notification) Exists() bool
Exists returns true when the Notification exists in the database.
func (*Notification) Insert ¶
func (n *Notification) Insert(ctx context.Context, db DB) error
Insert inserts the Notification to the database.
func (*Notification) NotificationType ¶
func (n *Notification) NotificationType(ctx context.Context, db DB) (*NotificationType, error)
NotificationType returns the NotificationType associated with the Notification's (NotificationTypeID).
Generated from foreign key 'fk_notification_type_id'.
func (*Notification) Save ¶
func (n *Notification) Save(ctx context.Context, db DB) error
Save saves the Notification to the database.
func (*Notification) Update ¶
func (n *Notification) Update(ctx context.Context, db DB) error
Update updates a Notification in the database.
func (*Notification) Upsert ¶
func (n *Notification) Upsert(ctx context.Context, db DB) error
Upsert performs an upsert for Notification.
type NotificationType ¶
type NotificationType struct {
ID uint64 `json:"id" db:"id"` // お知らせ種別ID
Title string `json:"title" db:"title"` // タイトル
// contains filtered or unexported fields
}
NotificationType represents a row from 'point_app.notification_types'.
func NotificationTypeByID ¶
NotificationTypeByID retrieves a row from 'point_app.notification_types' as a NotificationType.
Generated from index 'notification_types_id_pkey'.
func (*NotificationType) Delete ¶
func (nt *NotificationType) Delete(ctx context.Context, db DB) error
Delete deletes the NotificationType from the database.
func (*NotificationType) Deleted ¶
func (nt *NotificationType) Deleted() bool
Deleted returns true when the NotificationType has been marked for deletion from the database.
func (*NotificationType) Exists ¶
func (nt *NotificationType) Exists() bool
Exists returns true when the NotificationType exists in the database.
func (*NotificationType) Insert ¶
func (nt *NotificationType) Insert(ctx context.Context, db DB) error
Insert inserts the NotificationType to the database.
func (*NotificationType) Save ¶
func (nt *NotificationType) Save(ctx context.Context, db DB) error
Save saves the NotificationType to the database.
func (*NotificationType) Update ¶
func (nt *NotificationType) Update(ctx context.Context, db DB) error
Update updates a NotificationType in the database.
func (*NotificationType) Upsert ¶
func (nt *NotificationType) Upsert(ctx context.Context, db DB) error
Upsert performs an upsert for NotificationType.
type Transaction ¶
type Transaction struct {
ID uint64 `json:"id" db:"id"` // 取引の識別子
SendingUserID uint64 `json:"sending_user_id" db:"sending_user_id"` // 送信ユーザのID
ReceivingUserID uint64 `json:"receiving_user_id" db:"receiving_user_id"` // 受信ユーザのID
TransactionPoint int `json:"transaction_point" db:"transaction_point"` // 取引ポイント
TransactionAt time.Time `json:"transaction_at" db:"transaction_at"` // 取引日時
// contains filtered or unexported fields
}
Transaction represents a row from 'point_app.transactions'.
func TransactionByID ¶
TransactionByID retrieves a row from 'point_app.transactions' as a Transaction.
Generated from index 'transactions_id_pkey'.
func (*Transaction) Delete ¶
func (t *Transaction) Delete(ctx context.Context, db DB) error
Delete deletes the Transaction from the database.
func (*Transaction) Deleted ¶
func (t *Transaction) Deleted() bool
Deleted returns true when the Transaction has been marked for deletion from the database.
func (*Transaction) Exists ¶
func (t *Transaction) Exists() bool
Exists returns true when the Transaction exists in the database.
func (*Transaction) Insert ¶
func (t *Transaction) Insert(ctx context.Context, db DB) error
Insert inserts the Transaction to the database.
func (*Transaction) Save ¶
func (t *Transaction) Save(ctx context.Context, db DB) error
Save saves the Transaction to the database.
func (*Transaction) Update ¶
func (t *Transaction) Update(ctx context.Context, db DB) error
Update updates a Transaction in the database.
func (*Transaction) Upsert ¶
func (t *Transaction) Upsert(ctx context.Context, db DB) error
Upsert performs an upsert for Transaction.
type User ¶
type User struct {
ID int64 `json:"id" db:"id"` // ユーザーの識別子
FamilyName string `json:"family_name" db:"family_name"` // 苗字
FamilyNameKana string `json:"family_name_kana" db:"family_name_kana"` // 苗字カナ
FirstName string `json:"first_name" db:"first_name"` // 名前
FirstNameKana string `json:"first_name_kana" db:"first_name_kana"` // 名前カナ
Email string `json:"email" db:"email"` // メールアドレス
Password string `json:"password" db:"password"` // パスワードハッシュ
SendingPoint int `json:"sending_point" db:"sending_point"` // 送信可能ポイント
CreatedAt time.Time `json:"created_at" db:"created_at"` // レコード作成日時
UpdateAt time.Time `json:"update_at" db:"update_at"` // レコード修正日時
// contains filtered or unexported fields
}
User represents a row from 'point_app.users'.
func UserByEmail ¶
UserByEmail retrieves a row from 'point_app.users' as a User.
Generated from index 'uix_email'.
func UserByID ¶
UserByID retrieves a row from 'point_app.users' as a User.
Generated from index 'users_id_pkey'.
func (*User) Deleted ¶
Deleted returns true when the User has been marked for deletion from the database.