types

package
v0.16.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ErrCodeInvalidCredentials         router.ErrCode = "invalid_credentials"
	ErrCodeInvalidToken               router.ErrCode = "invalid_token"
	ErrCodeLoginEmpty                 router.ErrCode = "login_empty"
	ErrCodePasswordEmpty              router.ErrCode = "password_empty"
	ErrCodePasswordLength             router.ErrCode = "password_length"
	ErrCodeFailedToLogout             router.ErrCode = "failed_to_logout"
	ErrCodeFailedToGetUser            router.ErrCode = "failed_to_get_user"
	ErrCodeFailedToPatchUser          router.ErrCode = "failed_to_patch_user"
	ErrCodeFailedToGetUserCredentials router.ErrCode = "failed_to_get_user_credentials"
)

Variables

View Source
var (
	ErrLoginEmpty     = errors.New("login is empty")
	ErrPasswordEmpty  = errors.New("password is empty")
	ErrPasswordLength = errors.New("password length requirement not met")
	ErrLoginFailed    = errors.New("login failed")
	ErrTokenInvalid   = errors.New("token is invalid")
)

Functions

This section is empty.

Types

type CredentialsArgon2id

type CredentialsArgon2id struct {
	ID          uint   `json:"id" db:"id"`
	Login       string `json:"login" db:"login"`
	Hash        string `json:"hash" db:"hash"`
	Type        string `json:"type" db:"type"`
	Iterations  uint32 `json:"iterations" db:"iterations"`
	Memory      uint32 `json:"memory" db:"memory"`
	Parallelism uint8  `json:"parallelism" db:"parallelism"`
	Salt        string `json:"salt" db:"salt"`
	KeyLen      uint32 `json:"key_len" db:"key_len"`
	CreatedAt   int64  `json:"created_at" db:"created_at"`
	UpdatedAt   int64  `json:"updated_at" db:"updated_at"`
	DeletedAt   *int64 `json:"deleted_at,omitempty" db:"deleted_at"`
}

CredentialsArgon2id is the login method that uses Argon2id algorithm to hash the password.

type CredentialsMethods

type CredentialsMethods struct {
	Name        CredentialsType `json:"name"`
	Description string          `json:"description"`
}

type CredentialsType

type CredentialsType string
const CredentialsTypeLoginPassword CredentialsType = "Login and password"

type Session

type Session struct {
	ID        uint   `json:"id" db:"id"`
	Token     string `json:"token" db:"token"`
	UserID    uint   `json:"user,omitempty" db:"user_id"`
	CreatedAt int64  `json:"created_at" db:"created_at"`
	UpdatedAt int64  `json:"updated_at" db:"updated_at"`
	DeletedAt *int64 `json:"deleted_at,omitempty" db:"deleted_at"`
}

type User

type User struct {
	ID        uint   `json:"id" db:"id"`
	Username  string `json:"username" db:"username"`
	CreatedAt int64  `json:"created_at" db:"created_at"`
	UpdatedAt int64  `json:"updated_at" db:"updated_at"`
	DeletedAt *int64 `json:"deleted_at,omitempty" db:"deleted_at"`
}

Jump to

Keyboard shortcuts

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