models

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserDoesNotHaveRole = errors.New("user_does_not_have_role")
)

Functions

This section is empty.

Types

type Role

type Role struct {
	Id          string   `json:"id"`
	Name        string   `json:"name"`
	Permissions []string `json:"permissions"`
	IsDefault   bool     `json:"is_default"`
}

type User

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

func NewUser

func NewUser(id string) *User

func (*User) AddRole

func (u *User) AddRole(id string, name string, permissions []string, isDefault bool)

func (*User) Email

func (u *User) Email() string

func (*User) HasPermission

func (u *User) HasPermission(permission string) bool

func (*User) HashedPassword

func (u *User) HashedPassword() string

func (*User) Id

func (u *User) Id() string

func (*User) ImpersonatorId added in v1.4.0

func (u *User) ImpersonatorId() *string

func (*User) Name

func (u *User) Name() string

func (*User) Phone added in v1.3.2

func (u *User) Phone() string

func (*User) Picture

func (u *User) Picture() string

func (*User) PreferredUsername

func (u *User) PreferredUsername() string

func (*User) Roles

func (u *User) Roles() []Role

func (*User) SetEmail

func (u *User) SetEmail(email string)

func (*User) SetHashedPassword

func (u *User) SetHashedPassword(hashedPassword string)

func (*User) SetImpersonatorId added in v1.4.0

func (u *User) SetImpersonatorId(impersonatorId *string)

func (*User) SetName

func (u *User) SetName(name string)

func (*User) SetPhone added in v1.3.2

func (u *User) SetPhone(phone string)

func (*User) SetPicture

func (u *User) SetPicture(picture string)

func (*User) SetPreferredUsername

func (u *User) SetPreferredUsername(preferredUsername string)

Jump to

Keyboard shortcuts

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