gen

package
v0.0.0-...-069ff91 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	UserID    int32
	Token     string
	Valid     int32
	Chain     string
	CreatedAt time.Time
}

func (*AccessToken) GetChain

func (t *AccessToken) GetChain() string

func (*AccessToken) GetCreatedAt

func (t *AccessToken) GetCreatedAt() time.Time

func (*AccessToken) GetToken

func (t *AccessToken) GetToken() string

func (*AccessToken) GetUserID

func (t *AccessToken) GetUserID() int64

func (*AccessToken) GetValid

func (t *AccessToken) GetValid() bool

func (*AccessToken) SetChain

func (t *AccessToken) SetChain(chain string)

func (*AccessToken) SetCreatedAt

func (t *AccessToken) SetCreatedAt(at time.Time)

func (*AccessToken) SetToken

func (t *AccessToken) SetToken(token string)

func (*AccessToken) SetUserID

func (t *AccessToken) SetUserID(id int64)

func (*AccessToken) SetValid

func (t *AccessToken) SetValid(valid bool)

type CreateAccessTokenParams

type CreateAccessTokenParams struct {
	UserID    int32
	Token     string
	Valid     int32
	Chain     string
	CreatedAt time.Time
}

type CreateOAuth2IdentityParams

type CreateOAuth2IdentityParams struct {
	UserID   int32
	Provider string
	Identity string
}

type CreateRefreshTokenParams

type CreateRefreshTokenParams struct {
	UserID    int32
	Token     string
	Valid     int32
	Chain     string
	CreatedAt time.Time
}

type CreateUserParams

type CreateUserParams struct {
	Email         string
	Password      sql.NullString
	TotpSecret    sql.NullString
	Confirmed     int32
	ConfirmToken  sql.NullString
	RecoveryToken sql.NullString
	LockedUntil   sql.NullTime
	Attempts      int32
	LastAttempt   sql.NullTime
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type GetAccessTokenParams

type GetAccessTokenParams struct {
	UserID int32
	Token  string
}

type GetRefreshTokenParams

type GetRefreshTokenParams struct {
	UserID int32
	Token  string
}

type GetUserByOAuth2IdentityParams

type GetUserByOAuth2IdentityParams struct {
	Provider string
	Identity string
}

type InvalidateAccessTokenChainParams

type InvalidateAccessTokenChainParams struct {
	UserID int32
	Chain  string
}

type InvalidateRefreshTokenChainParams

type InvalidateRefreshTokenChainParams struct {
	UserID int32
	Chain  string
}

type InvalidateRefreshTokenParams

type InvalidateRefreshTokenParams struct {
	UserID int32
	Token  string
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) CreateAccessToken

func (q *Queries) CreateAccessToken(ctx context.Context, arg CreateAccessTokenParams) error

func (*Queries) CreateOAuth2Identity

func (q *Queries) CreateOAuth2Identity(ctx context.Context, arg CreateOAuth2IdentityParams) error

func (*Queries) CreateRefreshToken

func (q *Queries) CreateRefreshToken(ctx context.Context, arg CreateRefreshTokenParams) error

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (sql.Result, error)

func (*Queries) GetAccessToken

func (q *Queries) GetAccessToken(ctx context.Context, arg GetAccessTokenParams) (AccessToken, error)

func (*Queries) GetRefreshToken

func (q *Queries) GetRefreshToken(ctx context.Context, arg GetRefreshTokenParams) (RefreshToken, error)

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, id int64) (User, error)

func (*Queries) GetUserByConfirmationToken

func (q *Queries) GetUserByConfirmationToken(ctx context.Context, confirmToken sql.NullString) (User, error)

func (*Queries) GetUserByEmail

func (q *Queries) GetUserByEmail(ctx context.Context, email string) (User, error)

func (*Queries) GetUserByOAuth2Identity

func (q *Queries) GetUserByOAuth2Identity(ctx context.Context, arg GetUserByOAuth2IdentityParams) (User, error)

func (*Queries) GetUserByRecoveryToken

func (q *Queries) GetUserByRecoveryToken(ctx context.Context, recoveryToken sql.NullString) (User, error)

func (*Queries) GetUserByUsername

func (q *Queries) GetUserByUsername(ctx context.Context, username sql.NullString) (User, error)

func (*Queries) GetUserPermissions

func (q *Queries) GetUserPermissions(ctx context.Context, userID int32) ([]string, error)

func (*Queries) GetUserRoles

func (q *Queries) GetUserRoles(ctx context.Context, userID int32) ([]string, error)

func (*Queries) InvalidateAccessTokenChain

func (q *Queries) InvalidateAccessTokenChain(ctx context.Context, arg InvalidateAccessTokenChainParams) error

func (*Queries) InvalidateAccessTokens

func (q *Queries) InvalidateAccessTokens(ctx context.Context, userID int32) error

func (*Queries) InvalidateRefreshToken

func (q *Queries) InvalidateRefreshToken(ctx context.Context, arg InvalidateRefreshTokenParams) error

func (*Queries) InvalidateRefreshTokenChain

func (q *Queries) InvalidateRefreshTokenChain(ctx context.Context, arg InvalidateRefreshTokenChainParams) error

func (*Queries) InvalidateRefreshTokens

func (q *Queries) InvalidateRefreshTokens(ctx context.Context, userID int32) error

func (*Queries) PruneAccessTokens

func (q *Queries) PruneAccessTokens(ctx context.Context, createdAt time.Time) error

func (*Queries) PruneRefreshTokens

func (q *Queries) PruneRefreshTokens(ctx context.Context, createdAt time.Time) error

func (*Queries) RemoveOAuth2Identity

func (q *Queries) RemoveOAuth2Identity(ctx context.Context, arg RemoveOAuth2IdentityParams) error

func (*Queries) UpdateUser

func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type RefreshToken

type RefreshToken struct {
	UserID    int32
	Token     string
	Valid     int32
	Chain     string
	CreatedAt time.Time
}

func (*RefreshToken) GetChain

func (t *RefreshToken) GetChain() string

func (*RefreshToken) GetCreatedAt

func (t *RefreshToken) GetCreatedAt() time.Time

func (*RefreshToken) GetToken

func (t *RefreshToken) GetToken() string

func (*RefreshToken) GetUserID

func (t *RefreshToken) GetUserID() int64

func (*RefreshToken) GetValid

func (t *RefreshToken) GetValid() bool

func (*RefreshToken) SetChain

func (t *RefreshToken) SetChain(chain string)

func (*RefreshToken) SetCreatedAt

func (t *RefreshToken) SetCreatedAt(at time.Time)

func (*RefreshToken) SetToken

func (t *RefreshToken) SetToken(token string)

func (*RefreshToken) SetUserID

func (t *RefreshToken) SetUserID(id int64)

func (*RefreshToken) SetValid

func (t *RefreshToken) SetValid(valid bool)

type RemoveOAuth2IdentityParams

type RemoveOAuth2IdentityParams struct {
	UserID   int32
	Provider string
	Identity string
}

type UpdateUserParams

type UpdateUserParams struct {
	Email         string
	Password      sql.NullString
	TotpSecret    sql.NullString
	Confirmed     int32
	ConfirmToken  sql.NullString
	RecoveryToken sql.NullString
	LockedUntil   sql.NullTime
	Attempts      int32
	LastAttempt   sql.NullTime
	ID            int64
}

type User

type User struct {
	ID            int64
	Email         string
	Username      sql.NullString
	Password      sql.NullString
	TotpSecret    sql.NullString
	Confirmed     int32
	ConfirmToken  sql.NullString
	RecoveryToken sql.NullString
	LockedUntil   sql.NullTime
	Attempts      int32
	LastAttempt   sql.NullTime
	CreatedAt     time.Time
	LastLogin     time.Time
}

func (*User) GetAttempts

func (u *User) GetAttempts() int

func (*User) GetConfirmToken

func (u *User) GetConfirmToken() string

func (*User) GetConfirmed

func (u *User) GetConfirmed() bool

func (*User) GetCreatedAt

func (u *User) GetCreatedAt() time.Time

func (*User) GetEmail

func (u *User) GetEmail() string

func (*User) GetID

func (u *User) GetID() int64

func (*User) GetLastAttempt

func (u *User) GetLastAttempt() time.Time

func (*User) GetLastLogin

func (u *User) GetLastLogin() time.Time

func (*User) GetLockedUntil

func (u *User) GetLockedUntil() time.Time

func (*User) GetPassword

func (u *User) GetPassword() string

func (*User) GetRecoveryToken

func (u *User) GetRecoveryToken() string

func (*User) GetTOTPSecret

func (u *User) GetTOTPSecret() string

func (*User) GetUsername

func (u *User) GetUsername() string

func (*User) SetAttempts

func (u *User) SetAttempts(attempts int)

func (*User) SetConfirmToken

func (u *User) SetConfirmToken(token string)

func (*User) SetConfirmed

func (u *User) SetConfirmed(confirmed bool)

func (*User) SetCreatedAt

func (u *User) SetCreatedAt(at time.Time)

func (*User) SetEmail

func (u *User) SetEmail(email string)

func (*User) SetID

func (u *User) SetID(id int64)

func (*User) SetLastAttempt

func (u *User) SetLastAttempt(at time.Time)

func (*User) SetLastLogin

func (u *User) SetLastLogin(at time.Time)

func (*User) SetLockedUntil

func (u *User) SetLockedUntil(until time.Time)

func (*User) SetPassword

func (u *User) SetPassword(password string)

func (*User) SetRecoveryToken

func (u *User) SetRecoveryToken(token string)

func (*User) SetTOTPSecret

func (u *User) SetTOTPSecret(secret string)

func (*User) SetUsername

func (u *User) SetUsername(username string)

type UserIdentity

type UserIdentity struct {
	UserID   int32
	Provider string
	Identity string
}

type UserPermission

type UserPermission struct {
	UserID     int32
	Permission string
}

type UserRole

type UserRole struct {
	UserID int32
	Role   string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL