package models
import "github.com/go-arrower/arrower/contexts/auth/internal/interfaces/repository/models"
Index ¶
- type AllUsersParams
- type AuthSession
- type AuthUser
- type AuthUserVerification
- type CreateUserParams
- type CreateVerificationTokenParams
- type DBTX
- type Queries
- func New(db DBTX) *Queries
- func (q *Queries) AllSessions(ctx context.Context) ([]AuthSession, error)
- func (q *Queries) AllUsers(ctx context.Context, arg AllUsersParams) ([]AuthUser, error)
- func (q *Queries) AllUsersByIDs(ctx context.Context, dollar_1 []uuid.UUID) ([]AuthUser, error)
- func (q *Queries) CountUsers(ctx context.Context) (int64, error)
- func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (AuthUser, error)
- func (q *Queries) CreateVerificationToken(ctx context.Context, arg CreateVerificationTokenParams) error
- func (q *Queries) DeleteAllUsers(ctx context.Context) error
- func (q *Queries) DeleteSessionByKey(ctx context.Context, key []byte) error
- func (q *Queries) DeleteUser(ctx context.Context, dollar_1 []uuid.UUID) error
- func (q *Queries) FindSessionDataByKey(ctx context.Context, key []byte) ([]byte, error)
- func (q *Queries) FindSessionsByUserID(ctx context.Context, userID uuid.NullUUID) ([]AuthSession, error)
- func (q *Queries) FindUserByID(ctx context.Context, id uuid.UUID) (AuthUser, error)
- func (q *Queries) FindUserByLogin(ctx context.Context, login string) (AuthUser, error)
- func (q *Queries) UpsertNewSession(ctx context.Context, arg UpsertNewSessionParams) error
- func (q *Queries) UpsertSessionData(ctx context.Context, arg UpsertSessionDataParams) error
- func (q *Queries) UpsertUser(ctx context.Context, arg UpsertUserParams) (AuthUser, error)
- func (q *Queries) UserExistsByID(ctx context.Context, id uuid.UUID) (bool, error)
- func (q *Queries) UserExistsByLogin(ctx context.Context, login string) (bool, error)
- func (q *Queries) VerificationTokenByToken(ctx context.Context, token uuid.UUID) (AuthUserVerification, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type UpsertNewSessionParams
- type UpsertSessionDataParams
- type UpsertUserParams
Types ¶
type AllUsersParams ¶
type AuthSession ¶
type AuthSession struct { Key []byte Data []byte ExpiresAtUtc pgtype.Timestamptz UserID uuid.NullUUID UserAgent string CreatedAt pgtype.Timestamptz UpdatedAt pgtype.Timestamptz }
type AuthUser ¶
type AuthUser struct { ID uuid.UUID CreatedAt pgtype.Timestamptz UpdatedAt pgtype.Timestamptz Login string PasswordHash string NameFirstname string NameLastname string NameDisplayname string Birthday pgtype.Date Locale string TimeZone string PictureUrl string Profile pgtype.Hstore VerifiedAtUtc pgtype.Timestamptz BlockedAtUtc pgtype.Timestamptz SuperuserAtUtc pgtype.Timestamptz }
type AuthUserVerification ¶
type AuthUserVerification struct { Token uuid.UUID UserID uuid.UUID ValidUntilUtc pgtype.Timestamptz CreatedAt pgtype.Timestamptz UpdatedAt pgtype.Timestamptz }
type CreateUserParams ¶
type CreateUserParams struct { ID uuid.UUID Login string PasswordHash string VerifiedAtUtc pgtype.Timestamptz BlockedAtUtc pgtype.Timestamptz }
type CreateVerificationTokenParams ¶
type CreateVerificationTokenParams struct { Token uuid.UUID UserID uuid.UUID ValidUntilUtc pgtype.Timestamptz }
type DBTX ¶
type DBTX interface { Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error) Query(context.Context, string, ...interface{}) (pgx.Rows, error) QueryRow(context.Context, string, ...interface{}) pgx.Row }
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func New ¶
func (*Queries) AllSessions ¶
func (q *Queries) AllSessions(ctx context.Context) ([]AuthSession, error)
------------------- ---- Session ------ -------------------
func (*Queries) AllUsers ¶
---------------- ---- User ------ ----------------
func (*Queries) AllUsersByIDs ¶
func (*Queries) CountUsers ¶
func (*Queries) CreateUser ¶
func (*Queries) CreateVerificationToken ¶
func (q *Queries) CreateVerificationToken(ctx context.Context, arg CreateVerificationTokenParams) error
func (*Queries) DeleteAllUsers ¶
func (*Queries) DeleteSessionByKey ¶
func (*Queries) DeleteUser ¶
func (*Queries) FindSessionDataByKey ¶
func (*Queries) FindSessionsByUserID ¶
func (q *Queries) FindSessionsByUserID(ctx context.Context, userID uuid.NullUUID) ([]AuthSession, error)
func (*Queries) FindUserByID ¶
func (*Queries) FindUserByLogin ¶
func (*Queries) UpsertNewSession ¶
func (q *Queries) UpsertNewSession(ctx context.Context, arg UpsertNewSessionParams) error
func (*Queries) UpsertSessionData ¶
func (q *Queries) UpsertSessionData(ctx context.Context, arg UpsertSessionDataParams) error
func (*Queries) UpsertUser ¶
func (*Queries) UserExistsByID ¶
func (*Queries) UserExistsByLogin ¶
func (*Queries) VerificationTokenByToken ¶
func (q *Queries) VerificationTokenByToken(ctx context.Context, token uuid.UUID) (AuthUserVerification, error)
func (*Queries) WithTx ¶
type UpsertNewSessionParams ¶
type UpsertSessionDataParams ¶
type UpsertSessionDataParams struct { Key []byte Data []byte ExpiresAtUtc pgtype.Timestamptz }
type UpsertUserParams ¶
type UpsertUserParams struct { ID uuid.UUID CreatedAt pgtype.Timestamptz Login string PasswordHash string NameFirstname string NameLastname string NameDisplayname string Birthday pgtype.Date Locale string TimeZone string PictureUrl string Profile pgtype.Hstore VerifiedAtUtc pgtype.Timestamptz BlockedAtUtc pgtype.Timestamptz SuperuserAtUtc pgtype.Timestamptz }
Source Files ¶
- Version
- v0.0.0-20250311203644-ab26c1152cb4 (latest)
- Published
- Mar 11, 2025
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 1 week ago –
Tools for package owners.