user

package
v0.0.0-...-278bb9c Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package user defines the database entities for usersb

Index

Constants

View Source
const (
	// User can just use images and change their own image
	User UserRole = "user"
	// Moderator can change or upload system images
	Moderator = "moderator"
	// Admin can do anything on the system
	Admin = "admin"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type UserModel

type UserModel struct {
	// Name is a human-readable identifier for a user (or entity) of the system
	Username string               `gorm:"unique;not null;primaryKey"`
	Name     string               `gorm:"not null"`
	Email    string               `gorm:"unique;not null"`
	Role     UserRole             `gorm:"not null;"`
	Images   []images2.ImageModel `json:"-" gorm:"foreignKey:Username;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
	Setups   []images2.ImageSetup `json:"-" gorm:"foreignKey:Username;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
}

UserModel (noun) one who uses, not necessarily a single person nolint: golint

type UserRole

type UserRole string

UserRole is an enum which stores the roles a user can have. nolint: golint

Jump to

Keyboard shortcuts

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