Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnknownRole = errors.New("unknown value for credentials_role") ErrUnsupportedRoleType = errors.New("unsupported type for credentials_role") )
View Source
var RoleConverter = grpc.NewProtoConverter( grpc.ProtoMapper[commonv1.UserRole, Role]{ commonv1.UserRole_USER_ROLE_EARLY_ACCESS_PROGRAM: RoleEarlyAccessProgram, commonv1.UserRole_USER_ROLE_ADMIN: RoleAdmin, commonv1.UserRole_USER_ROLE_CORE: RoleCore, }, commonv1.UserRole_USER_ROLE_UNSPECIFIED, RoleNone, )
View Source
var RolesSorted = []Role{ RoleNone, RoleEarlyAccessProgram, RoleAdmin, RoleCore, }
View Source
var SortCredentialsConverter = grpc.NewProtoConverter( grpc.ProtoMapper[credentialsv1.Sort, SortCredentials]{ credentialsv1.Sort_SORT_BY_EMAIL: SortCredentialsEmail, credentialsv1.Sort_SORT_BY_ROLE: SortCredentialsRole, credentialsv1.Sort_SORT_BY_CREATED_AT: SortCredentialsCreatedAt, credentialsv1.Sort_SORT_BY_UPDATED_AT: SortCredentialsUpdatedAt, }, credentialsv1.Sort_SORT_UNSPECIFIED, SortCredentialsNone, )
Functions ¶
func RegisterRole ¶
func RegisterRole(customValidator *validator.Validate)
func RegisterSortCredentials ¶
func RegisterSortCredentials(customValidator *validator.Validate)
Types ¶
type Credential ¶
type Credential struct { bun.BaseModel `bun:"table:credentials,alias:credentials"` ID uuid.UUID `bun:"id,pk,type:uuid"` Email string `bun:"email"` Role Role `bun:"role,type:credentials_role"` EmailValidationTokenID string `bun:"email_validation_token_id"` PendingEmailValidationTokenID string `bun:"pending_email_validation_token_id"` PasswordTokenID string `bun:"password_token_id"` ResetPasswordTokenID string `bun:"reset_password_token_id"` CreatedAt time.Time `bun:"created_at"` UpdatedAt *time.Time `bun:"updated_at"` }
type SortCredentials ¶
type SortCredentials string
const ( SortCredentialsNone SortCredentials = "" SortCredentialsEmail SortCredentials = "email" SortCredentialsRole SortCredentials = "role" SortCredentialsCreatedAt SortCredentials = "created_at" SortCredentialsUpdatedAt SortCredentials = "updated_at" )
Click to show internal directories.
Click to hide internal directories.