auth

package
v0.0.0-...-b9f41be Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Role

type Role int
const (
	NilRole Role = iota
	DirectorRole
	AdminRole
	StaffRole
)

func ParseUserType

func ParseUserType(s string) Role

func (Role) MarshalJSON

func (ut Role) MarshalJSON() ([]byte, error)

func (*Role) Scan

func (ut *Role) Scan(src any) error

func (Role) String

func (ut Role) String() string

func (*Role) UnmarshalJSON

func (ut *Role) UnmarshalJSON(raw []byte) error

func (Role) Value

func (ut Role) Value() (driver.Value, error)

type User

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

func NewUser

func NewUser(
	id uuid.UUID,
	username string,
	userRoles map[string]UserRole,
) User

func (User) ID

func (u User) ID() uuid.UUID

func (User) UserRoles

func (u User) UserRoles() map[string]UserRole

func (User) Username

func (u User) Username() string

type UserRole

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

func NewUserRole

func NewUserRole(
	activity org.Activity,
	role Role,
) UserRole

func (UserRole) Activity

func (ur UserRole) Activity() org.Activity

func (UserRole) Role

func (ur UserRole) Role() Role

Jump to

Keyboard shortcuts

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