model

package
v0.0.0-...-a8d7ca2 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 8 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 Build

type Build struct {
	ID          string `gorm:"primaryKey;length:20"`
	PackID      string `gorm:"index;length:20"`
	Pack        *Pack
	Name        string  `gorm:"length:255"`
	MinecraftID *string `gorm:"index:idx_id;length:20"`
	Minecraft   *Minecraft
	ForgeID     *string `gorm:"index:idx_id;length:20"`
	Forge       *Forge
	NeoforgeID  *string `gorm:"index:idx_id;length:20"`
	Neoforge    *Neoforge
	QuiltID     *string `gorm:"index:idx_id;length:20"`
	Quilt       *Quilt
	FabricID    *string `gorm:"index:idx_id;length:20"`
	Fabric      *Fabric
	Java        string `gorm:"length:255"`
	Memory      string `gorm:"length:255"`
	Latest      bool   `gorm:"default:false"`
	Recommended bool   `gorm:"default:false"`
	Public      bool   `gorm:"default:true"`
	CreatedAt   time.Time
	UpdatedAt   time.Time
	Versions    []*BuildVersion
}

Build within Kleister.

func (*Build) BeforeSave

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

BeforeSave defines the hook executed before every save.

type BuildParams

type BuildParams struct {
	ListParams

	PackID  string
	BuildID string
}

BuildParams defines parameters for builds.

type BuildVersion

type BuildVersion struct {
	BuildID   string `gorm:"primaryKey;autoIncrement:false;length:20"`
	Build     *Build
	VersionID string `gorm:"primaryKey;autoIncrement:false;length:20"`
	Version   *Version
	CreatedAt time.Time
	UpdatedAt time.Time
}

BuildVersion within Kleister.

type BuildVersionParams

type BuildVersionParams struct {
	ListParams

	PackID    string
	BuildID   string
	ModID     string
	VersionID string
	Perm      string
}

BuildVersionParams defines parameters for build versions.

type Fabric

type Fabric struct {
	ID        string `gorm:"primaryKey;length:20"`
	Name      string `gorm:"unique;length:64"`
	CreatedAt time.Time
	UpdatedAt time.Time
	Builds    []*Build
}

Fabric within Kleister.

func (*Fabric) BeforeCreate

func (m *Fabric) BeforeCreate(_ *gorm.DB) error

BeforeCreate defines the hook executed before every create.

type FabricBuildParams

type FabricBuildParams struct {
	ListParams

	FabricID string
	PackID   string
	BuildID  string
}

FabricBuildParams defines parameters for fabric builds.

type Forge

type Forge struct {
	ID        string `gorm:"primaryKey;length:20"`
	Name      string `gorm:"unique;length:64"`
	Minecraft string `gorm:"index;length:64"`
	CreatedAt time.Time
	UpdatedAt time.Time
	Builds    []*Build
}

Forge rwithin Kleister.

func (*Forge) BeforeCreate

func (m *Forge) BeforeCreate(_ *gorm.DB) error

BeforeCreate defines the hook executed before every create.

type ForgeBuildParams

type ForgeBuildParams struct {
	ListParams

	ForgeID string
	PackID  string
	BuildID string
}

ForgeBuildParams defines parameters for forge builds.

type ListParams

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

ListParams defines optional list attributes.

type Minecraft

type Minecraft struct {
	ID        string `gorm:"primaryKey;length:20"`
	Name      string `gorm:"unique;length:64"`
	Type      string `gorm:"index;length:64"`
	CreatedAt time.Time
	UpdatedAt time.Time
	Builds    []*Build
}

Minecraft within Kleister.

func (*Minecraft) BeforeSave

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

BeforeSave defines the hook executed before every save.

type MinecraftBuildParams

type MinecraftBuildParams struct {
	ListParams

	MinecraftID string
	PackID      string
	BuildID     string
}

MinecraftBuildParams defines parameters for minecraft builds.

type Mod

type Mod struct {
	ID          string `gorm:"primaryKey;length:20"`
	Slug        string `gorm:"unique;length:255"`
	Name        string `gorm:"unique;length:255"`
	Side        string `gorm:"index;length:64"`
	Description string
	Author      string
	Website     string
	Donate      string
	Public      bool `gorm:"default:true"`
	CreatedAt   time.Time
	UpdatedAt   time.Time
	Versions    []*Version
	Users       []*UserMod
	Teams       []*TeamMod
}

Mod within Kleister.

func (*Mod) BeforeSave

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

BeforeSave defines the hook executed before every save.

type Neoforge

type Neoforge struct {
	ID        string `gorm:"primaryKey;length:20"`
	Name      string `gorm:"unique;length:64"`
	CreatedAt time.Time
	UpdatedAt time.Time
	Builds    []*Build
}

Neoforge within Kleister.

func (*Neoforge) BeforeCreate

func (m *Neoforge) BeforeCreate(_ *gorm.DB) error

BeforeCreate defines the hook executed before every create.

type NeoforgeBuildParams

type NeoforgeBuildParams struct {
	ListParams

	NeoforgeID string
	PackID     string
	BuildID    string
}

NeoforgeBuildParams defines parameters for neoforge builds.

type Pack

type Pack struct {
	ID        string `gorm:"primaryKey;length:20"`
	Slug      string `gorm:"unique;length:255"`
	Name      string `gorm:"unique;length:255"`
	Back      *PackBack
	Icon      *PackIcon
	Website   string
	Public    bool `gorm:"default:true"`
	CreatedAt time.Time
	UpdatedAt time.Time
	Builds    []*Build
	Users     []*UserPack
	Teams     []*TeamPack
}

Pack within Kleister.

func (*Pack) BeforeSave

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

BeforeSave defines the hook executed before every save.

type PackBack

type PackBack struct {
	ID          string `gorm:"primaryKey;length:20"`
	Pack        *Pack
	PackID      string `gorm:"index;length:20"`
	Slug        string `gorm:"unique;length:255"`
	ContentType string
	MD5         string           `gorm:"column:md5"`
	Path        string           `gorm:"-"`
	URL         string           `gorm:"-"`
	Upload      *dataurl.DataURL `json:"-" gorm:"-"`
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

PackBack within Kleister.

func (*PackBack) BeforeSave

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

BeforeSave defines the hook executed before every save.

type PackIcon

type PackIcon struct {
	ID          string `gorm:"primaryKey;length:20"`
	Pack        *Pack
	PackID      string `gorm:"index;length:20"`
	Slug        string `gorm:"unique;length:255"`
	ContentType string
	MD5         string           `gorm:"column:md5"`
	Path        string           `gorm:"-"`
	URL         string           `gorm:"-"`
	Upload      *dataurl.DataURL `json:"-" gorm:"-"`
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

PackIcon within Kleister.

func (*PackIcon) BeforeSave

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

BeforeSave defines the hook executed before every save.

type PackLogo struct {
	ID          string `gorm:"primaryKey;length:20"`
	Pack        *Pack
	PackID      string `gorm:"index;length:20"`
	Slug        string `gorm:"unique;length:255"`
	ContentType string
	MD5         string           `gorm:"column:md5"`
	Path        string           `gorm:"-"`
	URL         string           `gorm:"-"`
	Upload      *dataurl.DataURL `json:"-" gorm:"-"`
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

PackLogo within Kleister.

func (*PackLogo) BeforeSave

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

BeforeSave defines the hook executed before every save.

type Quilt

type Quilt struct {
	ID        string `gorm:"primaryKey;length:20"`
	Name      string `gorm:"unique;length:64"`
	CreatedAt time.Time
	UpdatedAt time.Time
	Builds    []*Build
}

Quilt within Kleister.

func (*Quilt) BeforeCreate

func (m *Quilt) BeforeCreate(_ *gorm.DB) error

BeforeCreate defines the hook executed before every create.

type QuiltBuildParams

type QuiltBuildParams struct {
	ListParams

	QuiltID string
	PackID  string
	BuildID string
}

QuiltBuildParams defines parameters for quilt builds.

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
	Mods      []*TeamMod
	Packs     []*TeamPack
}

Team within Kleister.

func (*Team) BeforeSave

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

BeforeSave defines the hook executed before every save.

type TeamMod

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

TeamMod within Kleister.

type TeamModParams

type TeamModParams struct {
	ListParams

	TeamID string
	ModID  string
	Perm   string
}

TeamModParams defines parameters for team mods.

type TeamPack

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

TeamPack rwithin Kleister.

type TeamPackParams

type TeamPackParams struct {
	ListParams

	TeamID string
	PackID string
	Perm   string
}

TeamPackParams defines parameters for team packs.

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
	Mods      []*UserMod
	Packs     []*UserPack
}

User within Kleister.

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 UserMod

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

UserMod within Kleister.

type UserModParams

type UserModParams struct {
	ListParams

	UserID string
	ModID  string
	Perm   string
}

UserModParams defines parameters for user mods.

type UserPack

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

UserPack within Kleister.

type UserPackParams

type UserPackParams struct {
	ListParams

	UserID string
	PackID string
	Perm   string
}

UserPackParams defines parameters for user packs.

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 Kleister.

type UserTeamParams

type UserTeamParams struct {
	ListParams

	UserID string
	TeamID string
	Perm   string
}

UserTeamParams defines parameters for user teams.

type Version

type Version struct {
	ID        string `gorm:"primaryKey;length:20"`
	ModID     string `gorm:"index;length:20"`
	Mod       *Mod
	Name      string `gorm:"unique;length:255"`
	File      *VersionFile
	Public    bool `gorm:"default:true"`
	CreatedAt time.Time
	UpdatedAt time.Time
	Builds    []*BuildVersion
}

Version within Kleister.

func (*Version) BeforeSave

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

BeforeSave defines the hook executed before every save.

type VersionFile

type VersionFile struct {
	ID          string `gorm:"primaryKey;length:20"`
	Version     *Version
	VersionID   string `gorm:"index;length:20"`
	Slug        string `gorm:"unique;length:255"`
	ContentType string
	MD5         string           `gorm:"column:md5"`
	Upload      *dataurl.DataURL `json:"-" gorm:"-"`
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

VersionFile within Kleister.

func (*VersionFile) BeforeSave

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

BeforeSave defines the hook executed before every save.

type VersionParams

type VersionParams struct {
	ListParams

	ModID     string
	VersionID string
}

VersionParams defines parameters for versions.

Jump to

Keyboard shortcuts

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