model

package
v0.0.0-...-475c006 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Slugify

func Slugify(tx *gorm.DB, value, id string, force bool) string

Slugify generates a slug.

Types

type ListParams

type ListParams struct {
	Search string
	Sort   string
	Order  string
	Limit  int
	Offset int
}

ListParams defines optional list attributes.

type Team

type Team struct {
	ID        string `gorm:"primaryKey;length:20"`
	Scim      string `gorm:"length:255"`
	Slug      string `gorm:"unique;length:255"`
	Name      string `gorm:"unique;length:255"`
	CreatedAt time.Time
	UpdatedAt time.Time
	Users     []*UserTeam
}

Team within Gopad.

func (*Team) BeforeSave

func (m *Team) BeforeSave(tx *gorm.DB) error

BeforeSave defines the hook executed before every save.

type User

type User struct {
	ID        string `gorm:"primaryKey;length:20"`
	Scim      string `gorm:"length:255"`
	Username  string `gorm:"unique;length:255"`
	Password  string `gorm:"-"`
	Hashword  string `gorm:"lenght:255"`
	Email     string `gorm:"length:255"`
	Fullname  string `gorm:"length:255"`
	Profile   string `gorm:"-"`
	Active    bool   `gorm:"default:false"`
	Admin     bool   `gorm:"default:false"`
	CreatedAt time.Time
	UpdatedAt time.Time
	Auths     []*UserAuth
	Teams     []*UserTeam
}

User within Gopad.

func (*User) BeforeSave

func (m *User) BeforeSave(_ *gorm.DB) error

BeforeSave defines the hook executed before every save.

type UserAuth

type UserAuth struct {
	ID        string `gorm:"primaryKey;length:20"`
	UserID    string `gorm:"length:20"`
	User      *User
	Provider  string `gorm:"length:255"`
	Ref       string `gorm:"length:255"`
	CreatedAt time.Time
	UpdatedAt time.Time
}

UserAuth provides the model definition for a user auth.

func (*UserAuth) BeforeSave

func (m *UserAuth) BeforeSave(_ *gorm.DB) error

BeforeSave defines the hook executed before every save.

type UserTeam

type UserTeam struct {
	TeamID    string `gorm:"primaryKey;autoIncrement:false;length:20"`
	Team      *Team
	UserID    string `gorm:"primaryKey;autoIncrement:false;length:20"`
	User      *User
	Perm      string `gorm:"length:64"`
	CreatedAt time.Time
	UpdatedAt time.Time
}

UserTeam within Gopad.

type UserTeamParams

type UserTeamParams struct {
	ListParams

	UserID string
	TeamID string
	Perm   string
}

UserTeamParams defines parameters for user teams.

Jump to

Keyboard shortcuts

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