constant

package
v0.0.0-...-e74fef0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MasterPasswordType uint8 = 0
	UserPasswordType   uint8 = 1
)

Password types

View Source
const (
	RSCUnspecified = 0
	RSCSucceed     = 1
	RSCFailed      = 2
)

RegisterStatusCode

View Source
const (
	RoleIdSuperadmin uint8 = 1
	RoleIdAdmin      uint8 = 2
	RoleIdUser       uint8 = 3
)

Known roleIds

View Source
const (
	RedisPrefixGranted = "auth:granted"
)
View Source
const (
	RegexEmail = `^[a-zA-Z0-9.!#$%&'*/=?^_` + "`" + `{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$`
)

Variables

View Source
var (
	// Generic errors
	ErrNotFound = errors.New("Not found")
	ErrNoArg    = errors.New("No argument given")
	ErrInternal = errors.New("Internal error")

	// Specific errors
	ErrInvalidMethod           = errors.New("Invalid method")
	ErrInvalidUsernamePassword = errors.New("Invalid username/password")
	ErrPasswordIsTooWeak       = errors.New("Password is too weak")
	ErrMalformedEmail          = errors.New("Malformed email")
	ErrInvalidUserIdType       = errors.New("Invalid user ID type")
	ErrUserNotFound            = errors.New("User not found")
	ErrUserIsBlocked           = errors.New("User is blocked")
)

Known gRPC errors

All client-safe errors goes here

Functions

This section is empty.

Types

type LoginMethod

type LoginMethod uint8
const (
	LoginMethodLogin    LoginMethod = 1
	LoginMethodRecovery LoginMethod = 2
)

Login methods

type TokenType

type TokenType uint8
var (
	TokenTypeAccess  TokenType = 0
	TokenTypeRefresh TokenType = 1
)

type UserIdType

type UserIdType string
const (
	UserIdTypeUsername    UserIdType = "username"
	UserIdTypeEmail       UserIdType = "email"
	UserIdTypePhoneNumber UserIdType = "phone_number"
)

User identifier types

func (*UserIdType) Validate

func (u *UserIdType) Validate() error

Jump to

Keyboard shortcuts

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