models

package
v0.0.0-...-b20cf72 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthAction

type AuthAction struct {
	Id          uuid.UUID    `json:"id" gorm:"primaryKey;type:char(36);"`
	ResourceId  uuid.UUID    `json:"resourceId"`
	Resource    AuthResource `json:"-" gorm:"foreignKey:ResourceId;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	Name        string       `json:"name"`
	Description string       `json:"description" gorm:"type:text"`
	Roles       []*AuthRole  `json:"-" gorm:"many2many:role_actions;"`
}

func (*AuthAction) BeforeCreate

func (action *AuthAction) BeforeCreate(tx *gorm.DB) error

type AuthModule

type AuthModule struct {
	Id          uuid.UUID `json:"id" gorm:"primaryKey;type:char(36);"`
	Name        string    `json:"name" gorm:"unique"`
	Description string    `json:"description" gorm:"type:text"`
}

func (*AuthModule) BeforeCreate

func (module *AuthModule) BeforeCreate(tx *gorm.DB) error

type AuthResource

type AuthResource struct {
	Id          uuid.UUID  `json:"id" gorm:"primaryKey;type:char(36);"`
	ModuleId    uuid.UUID  `json:"moduleId"`
	Module      AuthModule `json:"-" gorm:"foreignKey:ModuleId;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	Name        string     `json:"name" gorm:"unique"`
	Description string     `json:"description" gorm:"type:text"`
}

func (*AuthResource) BeforeCreate

func (resource *AuthResource) BeforeCreate(tx *gorm.DB) error

type AuthRole

type AuthRole struct {
	Id          uuid.UUID       `json:"id" gorm:"primaryKey;type:char(36);"`
	Name        string          `json:"name"`
	Description string          `json:"description" gorm:"type:text"`
	Actions     []*AuthAction   `json:"actions" gorm:"many2many:role_actions;"`
	CreatedAt   time.Time       `json:"createdAt"`
	UpdatedAt   time.Time       `json:"updatedAt"`
	DeletedAt   *gorm.DeletedAt `json:"deletedAt" gorm:"index"`
}

func (*AuthRole) BeforeCreate

func (role *AuthRole) BeforeCreate(tx *gorm.DB) error

type OauthUser

type OauthUser struct {
	Id        uuid.UUID      `json:"id" gorm:"primaryKey;type:char(36)"`
	FirstName *string        `json:"firstName"`
	LastName  *string        `json:"lastName"`
	Email     string         `json:"email" gorm:"unique;not null;"`
	Language  string         `json:"language" gorm:"default:EN;not null;type:varchar(4)"`
	Password  string         `json:"password" gorm:"not null;"`
	RoleID    uuid.UUID      `json:"-"`
	Role      AuthRole       `json:"role" gorm:"constraint:OnUpdate:CASCADE;OnDelete:SET NULL"`
	CreatedAt time.Time      `json:"createdAt"`
	UpdatedAt time.Time      `json:"updatedAt"`
	DeletedAt gorm.DeletedAt `json:"deletedAt" gorm:"index"`
}

func (*OauthUser) BeforeCreate

func (user *OauthUser) BeforeCreate(tx *gorm.DB) error

Jump to

Keyboard shortcuts

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