Documentation
¶
Index ¶
- Constants
- type Build
- type BuildParams
- type BuildVersion
- type BuildVersionParams
- type Fabric
- type FabricBuildParams
- type Forge
- type ForgeBuildParams
- type Group
- type GroupMod
- type GroupModParams
- type GroupPack
- type GroupPackParams
- type ListParams
- type Minecraft
- type MinecraftBuildParams
- type Mod
- type ModAvatar
- type Neoforge
- type NeoforgeBuildParams
- type Pack
- type PackAvatar
- type Quilt
- type QuiltBuildParams
- type User
- type UserAuth
- type UserGroup
- type UserGroupParams
- type UserMod
- type UserModParams
- type UserPack
- type UserPackParams
- type UserToken
- type UserTokenKind
- type Version
- type VersionFile
- type VersionParams
Constants ¶
const ( // GroupModOwnerPerm defines the permission for an owner on group mods. GroupModOwnerPerm = OwnerPerm // GroupModAdminPerm defines the permission for an admin on group mods. GroupModAdminPerm = AdminPerm // GroupModUserPerm defines the permission for an user on group mods. GroupModUserPerm = UserPerm )
const ( // GroupPackOwnerPerm defines the permission for an owner on group packs. GroupPackOwnerPerm = OwnerPerm // GroupPackAdminPerm defines the permission for an admin on group packs. GroupPackAdminPerm = AdminPerm // GroupPackUserPerm defines the permission for an user on group packs. GroupPackUserPerm = UserPerm )
const ( // OwnerPerm defines the general permission for an owner. OwnerPerm = "owner" // AdminPerm defines the general permission for an admin. AdminPerm = "admin" // UserPerm defines the general permission for an user. UserPerm = "user" )
const ( // UserGroupOwnerPerm defines the permission for an owner on user groups. UserGroupOwnerPerm = OwnerPerm // UserGroupAdminPerm defines the permission for an admin on user groups. UserGroupAdminPerm = AdminPerm // UserGroupUserPerm defines the permission for an user on user groups. UserGroupUserPerm = UserPerm )
const ( // UserModOwnerPerm defines the permission for an owner on user mods. UserModOwnerPerm = OwnerPerm // UserModAdminPerm defines the permission for an admin on user mods. UserModAdminPerm = AdminPerm // UserModUserPerm defines the permission for an user on user mods. UserModUserPerm = UserPerm )
const ( // UserPackOwnerPerm defines the permission for an owner on user packs. UserPackOwnerPerm = OwnerPerm // UserPackAdminPerm defines the permission for an admin on user packs. UserPackAdminPerm = AdminPerm // UserPackUserPerm defines the permission for an user on user packs. UserPackUserPerm = UserPerm )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Build ¶
type Build struct {
bun.BaseModel `bun:"table:builds"`
ID string `bun:",pk,type:varchar(20)"`
PackID string `bun:"type:varchar(20)"`
Pack *Pack `bun:"rel:belongs-to,join:pack_id=id"`
Name string `bun:"type:varchar(255)"`
MinecraftID *string `bun:"type:varchar(20)"`
Minecraft *Minecraft `bun:"rel:belongs-to,join:minecraft_id=id"`
ForgeID *string `bun:"type:varchar(20)"`
Forge *Forge `bun:"rel:belongs-to,join:forge_id=id"`
NeoforgeID *string `bun:"type:varchar(20)"`
Neoforge *Neoforge `bun:"rel:belongs-to,join:neoforge_id=id"`
QuiltID *string `bun:"type:varchar(20)"`
Quilt *Quilt `bun:"rel:belongs-to,join:quilt_id=id"`
FabricID *string `bun:"type:varchar(20)"`
Fabric *Fabric `bun:"rel:belongs-to,join:fabric_id=id"`
Java string `bun:"type:varchar(255)"`
Memory string `bun:"type:varchar(255)"`
Latest bool `bun:"default:false"`
Recommended bool `bun:"default:false"`
Public bool `bun:"default:true"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
Versions []*BuildVersion `bun:"rel:has-many,join:id=build_id"`
}
Build defines the model for builds table.
type BuildParams ¶
type BuildParams struct {
ListParams
PackID string
BuildID string
}
BuildParams defines parameters for builds.
type BuildVersion ¶
type BuildVersion struct {
bun.BaseModel `bun:"table:build_versions"`
BuildID string `bun:",pk,type:varchar(20)"`
Build *Build `bun:"rel:belongs-to,join:build_id=id"`
VersionID string `bun:",pk,type:varchar(20)"`
Version *Version `bun:"rel:belongs-to,join:version_id=id"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
BuildVersion defines the model for build_versions table.
func (*BuildVersion) BeforeAppendModel ¶
BeforeAppendModel implements the bun hook interface.
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 {
bun.BaseModel `bun:"table:fabrics"`
ID string `bun:",pk,type:varchar(20)"`
Name string `bun:",unique,type:varchar(64)"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
Builds []*Build `bun:"rel:has-many,join:id=fabric_id"`
}
Fabric defines the model for fabrics table.
type FabricBuildParams ¶
type FabricBuildParams struct {
ListParams
FabricID string
PackID string
BuildID string
}
FabricBuildParams defines parameters for fabric builds.
type Forge ¶
type Forge struct {
bun.BaseModel `bun:"table:forges"`
ID string `bun:",pk,type:varchar(20)"`
Name string `bun:",unique,type:varchar(64)"`
Minecraft string `bun:"type:varchar(64)"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
Builds []*Build `bun:"rel:has-many,join:id=forge_id"`
}
Forge defines the model for forges table.
type ForgeBuildParams ¶
type ForgeBuildParams struct {
ListParams
ForgeID string
PackID string
BuildID string
}
ForgeBuildParams defines parameters for forge builds.
type Group ¶
type Group struct {
bun.BaseModel `bun:"table:groups"`
ID string `bun:",pk,type:varchar(20)"`
Scim string `bun:"type:varchar(255)"`
Slug string `bun:",unique,type:varchar(255)"`
Name string `bun:"type:varchar(255)"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
Users []*UserGroup `bun:"rel:has-many,join:id=group_id"`
Mods []*GroupMod `bun:"rel:has-many,join:id=group_id"`
Packs []*GroupPack `bun:"rel:has-many,join:id=group_id"`
}
Group defines the model for groups table.
type GroupMod ¶
type GroupMod struct {
GroupID string
Group *Group
ModID string
Mod *Mod
Perm string
CreatedAt time.Time
UpdatedAt time.Time
}
GroupMod defines the assignment of a group to a mod, backed by an OpenFGA relationship tuple rather than a database table.
type GroupModParams ¶
type GroupModParams struct {
ListParams
GroupID string
ModID string
Perm string
}
GroupModParams defines parameters for group mods.
type GroupPack ¶
type GroupPack struct {
GroupID string
Group *Group
PackID string
Pack *Pack
Perm string
CreatedAt time.Time
UpdatedAt time.Time
}
GroupPack defines the assignment of a group to a pack, backed by an OpenFGA relationship tuple rather than a database table.
type GroupPackParams ¶
type GroupPackParams struct {
ListParams
GroupID string
PackID string
Perm string
}
GroupPackParams defines parameters for group packs.
type ListParams ¶
ListParams defines optional list attributes.
type Minecraft ¶
type Minecraft struct {
bun.BaseModel `bun:"table:minecrafts"`
ID string `bun:",pk,type:varchar(20)"`
Name string `bun:",unique,type:varchar(64)"`
Type string `bun:"type:varchar(64)"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
Builds []*Build `bun:"rel:has-many,join:id=minecraft_id"`
}
Minecraft defines the model for minecrafts table.
type MinecraftBuildParams ¶
type MinecraftBuildParams struct {
ListParams
MinecraftID string
PackID string
BuildID string
}
MinecraftBuildParams defines parameters for minecraft builds.
type Mod ¶
type Mod struct {
bun.BaseModel `bun:"table:mods"`
ID string `bun:",pk,type:varchar(20)"`
Slug string `bun:",unique,type:varchar(255)"`
Name string `bun:",unique,type:varchar(255)"`
Avatar *ModAvatar `bun:"rel:has-one,join:id=mod_id"`
Side string `bun:"type:varchar(64)"`
Description string `bun:"type:text"`
Author string `bun:"type:varchar(255)"`
Website string `bun:"type:varchar(255)"`
Donate string `bun:"type:varchar(255)"`
Public bool `bun:"default:true"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
Versions []*Version `bun:"rel:has-many,join:id=mod_id"`
}
Mod defines the model for mods table.
type ModAvatar ¶
type ModAvatar struct {
bun.BaseModel `bun:"table:mod_avatars"`
ID string `bun:",pk,type:varchar(20)"`
Mod *Mod `bun:"rel:belongs-to,join:mod_id=id"`
ModID string `bun:"type:varchar(20)"`
Slug string `bun:"type:varchar(255)"`
URL string `bun:"-"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
ModAvatar defines the model for mod_avatars table.
type Neoforge ¶
type Neoforge struct {
bun.BaseModel `bun:"table:neoforges"`
ID string `bun:",pk,type:varchar(20)"`
Name string `bun:",unique,type:varchar(64)"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
Builds []*Build `bun:"rel:has-many,join:id=neoforge_id"`
}
Neoforge defines the model for neoforges table.
type NeoforgeBuildParams ¶
type NeoforgeBuildParams struct {
ListParams
NeoforgeID string
PackID string
BuildID string
}
NeoforgeBuildParams defines parameters for neoforge builds.
type Pack ¶
type Pack struct {
bun.BaseModel `bun:"table:packs"`
ID string `bun:",pk,type:varchar(20)"`
Slug string `bun:",unique,type:varchar(255)"`
Name string `bun:",unique,type:varchar(255)"`
Avatar *PackAvatar `bun:"rel:has-one,join:id=pack_id"`
Website string `bun:"type:varchar(255)"`
Public bool `bun:"default:true"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
Builds []*Build `bun:"rel:has-many,join:id=pack_id"`
}
Pack defines the model for packs table.
type PackAvatar ¶
type PackAvatar struct {
bun.BaseModel `bun:"table:pack_avatars"`
ID string `bun:",pk,type:varchar(20)"`
Pack *Pack `bun:"rel:belongs-to,join:pack_id=id"`
PackID string `bun:"type:varchar(20)"`
Slug string `bun:"type:varchar(255)"`
URL string `bun:"-"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
PackAvatar defines the model for pack_avatars table.
func (*PackAvatar) BeforeAppendModel ¶
BeforeAppendModel implements the bun hook interface.
type Quilt ¶
type Quilt struct {
bun.BaseModel `bun:"table:quilts"`
ID string `bun:",pk,type:varchar(20)"`
Name string `bun:",unique,type:varchar(64)"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
Builds []*Build `bun:"rel:has-many,join:id=quilt_id"`
}
Quilt defines the model for quilts table.
type QuiltBuildParams ¶
type QuiltBuildParams struct {
ListParams
QuiltID string
PackID string
BuildID string
}
QuiltBuildParams defines parameters for quilt builds.
type User ¶
type User struct {
bun.BaseModel `bun:"table:users"`
ID string `bun:",pk,type:varchar(20)"`
Scim string `bun:"type:varchar(255)"`
Username string `bun:",unique,type:varchar(255)"`
Password string `bun:"-"`
Hashword string `bun:"type:varchar(255)"`
Email string `bun:"type:varchar(255)"`
Fullname string `bun:"type:varchar(255)"`
Profile string `bun:"-"`
Active bool `bun:"default:false"`
Admin bool `bun:"default:false"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
Auths []*UserAuth `bun:"rel:has-many,join:id=user_id"`
// Groups, Mods and Packs hold the user's effective direct assignments,
// populated from OpenFGA tuples rather than loaded as a bun relation.
Groups []*UserGroup `bun:"-"`
Mods []*UserMod `bun:"-"`
Packs []*UserPack `bun:"-"`
}
User defines the model for users table.
type UserAuth ¶
type UserAuth struct {
bun.BaseModel `bun:"table:user_auths"`
ID string `bun:",pk,type:varchar(20)"`
UserID string `bun:"type:varchar(20)"`
User *User `bun:"rel:belongs-to,join:user_id=id"`
Provider string `bun:"type:varchar(255)"`
Ref string `bun:"type:varchar(255)"`
Login string `bun:"type:varchar(255)"`
Email string `bun:"type:varchar(255)"`
Name string `bun:"type:varchar(255)"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
UserAuth defines the model for user_auths table.
type UserGroup ¶
type UserGroup struct {
UserID string
User *User
GroupID string
Group *Group
Perm string
CreatedAt time.Time
UpdatedAt time.Time
}
UserGroup defines the membership of a user in a group, backed by an OpenFGA relationship tuple rather than a database table.
type UserGroupParams ¶
type UserGroupParams struct {
ListParams
UserID string
GroupID string
Perm string
}
UserGroupParams defines parameters for user groups.
type UserMod ¶
type UserMod struct {
UserID string
User *User
ModID string
Mod *Mod
Perm string
CreatedAt time.Time
UpdatedAt time.Time
}
UserMod defines the assignment of a user to a mod, backed by an OpenFGA relationship tuple rather than a database table.
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
User *User
PackID string
Pack *Pack
Perm string
CreatedAt time.Time
UpdatedAt time.Time
}
UserPack defines the assignment of a user to a pack, backed by an OpenFGA relationship tuple rather than a database table.
type UserPackParams ¶
type UserPackParams struct {
ListParams
UserID string
PackID string
Perm string
}
UserPackParams defines parameters for user packs.
type UserToken ¶
type UserToken struct {
bun.BaseModel `bun:"table:user_tokens"`
ID string `bun:",pk,type:varchar(20)"`
UserID string `bun:"type:varchar(20)"`
User *User `bun:"rel:belongs-to,join:user_id=id"`
Kind UserTokenKind `bun:"type:varchar(128)"`
Token string `bun:",unique,type:varchar(128)"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
UserToken defines the model for user_tokens table.
type UserTokenKind ¶
type UserTokenKind string
UserTokenKind is the custom type for kind of tokens.
const ( // UserTokenKindRedirect defines the kind used for redirects. UserTokenKindRedirect UserTokenKind = "redirect" )
type Version ¶
type Version struct {
bun.BaseModel `bun:"table:versions"`
ID string `bun:",pk,type:varchar(20)"`
ModID string `bun:"type:varchar(20)"`
Mod *Mod `bun:"rel:belongs-to,join:mod_id=id"`
Name string `bun:",unique,type:varchar(255)"`
File *VersionFile `bun:"rel:has-one,join:id=version_id"`
FileUpload *dataurl.DataURL `bun:"-"`
Public bool `bun:"default:true"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
Builds []*BuildVersion `bun:"rel:has-many,join:id=version_id"`
}
Version defines the model for versions table.
type VersionFile ¶
type VersionFile struct {
bun.BaseModel `bun:"table:version_files"`
ID string `bun:",pk,type:varchar(20)"`
Version *Version `bun:"rel:belongs-to,join:version_id=id"`
VersionID string `bun:"type:varchar(20)"`
Slug string `bun:"type:varchar(255)"`
ContentType string `bun:"type:varchar(255)"`
MD5 string `bun:"column:md5,type:varchar(255)"`
URL string `bun:"-"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
VersionFile defines the model for version_files table.
func (*VersionFile) BeforeAppendModel ¶
BeforeAppendModel implements the bun hook interface.
type VersionParams ¶
type VersionParams struct {
ListParams
ModID string
VersionID string
}
VersionParams defines parameters for versions.