Documentation ¶
Index ¶
- func CreateConnection(cfg config.PostgresConfig) (*sqlx.DB, error)
- type EventRepository
- type EventScanStruct
- type UserRepository
- func (s UserRepository) Delete(id int) error
- func (s UserRepository) Find(id int) (user userland.User, err error)
- func (s UserRepository) FindByEmail(email string) (user userland.User, err error)
- func (s UserRepository) Insert(user *userland.User) error
- func (s UserRepository) StoreBackupCodes(user userland.User) error
- func (s UserRepository) Update(user userland.User) error
- type UserScanStruct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateConnection ¶
func CreateConnection(cfg config.PostgresConfig) (*sqlx.DB, error)
Types ¶
type EventRepository ¶
type EventRepository struct {
// contains filtered or unexported fields
}
EventRepository is implementation of EventRepository interface of userland domain using postgre
func NewEventRepository ¶
func NewEventRepository(conn *sqlx.DB) *EventRepository
NewEventRepository is constructor to create story repository
func (EventRepository) DeleteAllByUserID ¶
func (s EventRepository) DeleteAllByUserID(userID int) error
func (EventRepository) FindAll ¶
func (e EventRepository) FindAll(filter userland.EventFilterOptions, paging userland.EventPagingOptions) (events userland.Events, eventsCount int, err error)
Find User by id
type EventScanStruct ¶
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
UserRepository is implementation of UserRepository interface of userland domain using postgre
func NewUserRepository ¶
func NewUserRepository(conn *sqlx.DB) *UserRepository
NewUserRepository is constructor to create story repository
func (UserRepository) Delete ¶
func (s UserRepository) Delete(id int) error
Delete delete story by id
func (UserRepository) Find ¶
func (s UserRepository) Find(id int) (user userland.User, err error)
Find User by id
func (UserRepository) FindByEmail ¶
func (s UserRepository) FindByEmail(email string) (user userland.User, err error)
FindByEmail User by email
func (UserRepository) Insert ¶
func (s UserRepository) Insert(user *userland.User) error
Insert insert story to datastore
func (UserRepository) StoreBackupCodes ¶
func (s UserRepository) StoreBackupCodes(user userland.User) error
type UserScanStruct ¶
type UserScanStruct struct { ID int Email string Fullname string Phone sql.NullString Location sql.NullString Bio sql.NullString WebURL sql.NullString `db:"web_url"` PictureURL sql.NullString `db:"picture_url"` Password string TFAEnabled sql.NullBool `db:"tfa_enabled"` Verified sql.NullBool BackupCodes pq.StringArray `db:"backup_codes"` TFAEnabledAt pq.NullTime `db:"tfa_enabled_at"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` }
Click to show internal directories.
Click to hide internal directories.