types

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func RoleArrStr

func RoleArrStr(roles ...Role) []string

RoleArrStr converts variadic Role parameters into a slice of strings. Parameters:

  • roles (...Role): Variable number of Role parameters

Returns:

  • []string: Slice containing string representations of the roles

func UserStatusArrStr

func UserStatusArrStr(userStatus ...UserStatus) []string

UserStatusArrStr converts variable number of UserStatus to array of strings.

Parameters:

  • userStatus: Variable number of UserStatus values

Returns:

  • []string: Array of UserStatus values as strings (e.g. ["active", "pending", "blocked"])

Types

type Role

type Role string
const (
	RoleNA        Role = "na"
	RoleAdmin     Role = "admin"
	RoleModerator Role = "moderator"
	RoleMember    Role = "member"
	RoleGuest     Role = "guest"
)

User property types

func (Role) ID

func (e Role) ID() RoleID

type RoleID

type RoleID uint
const (
	RoleNAID RoleID = iota
	RoleAdminID
	RoleModeratorID
	RoleMemberID
	RoleGuestID
)

Role ID and id match with the database.

func (RoleID) Name

func (e RoleID) Name() Role

type UserStatus

type UserStatus string
const (
	UserStatusActive  UserStatus = "active"
	UserStatusPending UserStatus = "pending"
	UserStatusBlocked UserStatus = "blocked"
)

User property types

Jump to

Keyboard shortcuts

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