Documentation ¶
Index ¶
- func AddGuideTag(ctx context.Context, guideID string, tagID string) error
- func AddModTag(ctx context.Context, modID string, tagID string) error
- func ClearGuideTags(ctx context.Context, guideID string) error
- func ClearModTags(ctx context.Context, modID string) error
- func ContextWithDB(ctx context.Context, db *gorm.DB) context.Context
- func CreateVersion(ctx context.Context, version *Version) error
- func DBCtx(ctx context.Context) *gorm.DB
- func DBFromContext(ctx context.Context) *gorm.DB
- func Delete(ctx context.Context, object interface{})
- func DeleteForced(ctx context.Context, object interface{})
- func DeleteMod(ctx context.Context, modID string)
- func GetBootstrapVersionCount(ctx context.Context, filter *models.BootstrapVersionFilter) int64
- func GetGuideCount(ctx context.Context, filter *models.GuideFilter) int64
- func GetModCount(ctx context.Context, search string, unapproved bool) int64
- func GetModCountNew(ctx context.Context, filter *models.ModFilter, unapproved bool) int64
- func GetModLatestVersions(ctx context.Context, modID string, unapproved bool) *[]Version
- func GetModsLatestVersions(ctx context.Context, modIds []string, unapproved bool) *[]Version
- func GetSMLLatestVersions(ctx context.Context) *[]SMLVersion
- func GetSMLVersionCount(ctx context.Context, filter *models.SMLVersionFilter) int64
- func GetUserSession(ctx context.Context, oauthUser *oauth.UserData, userAgent string) (*UserSession, *User, bool)
- func GetUsersByID(ctx context.Context, userIds []string) *[]User
- func GetVersionCountNew(ctx context.Context, filter *models.VersionFilter, unapproved bool) int64
- func IncrementGuideViews(ctx context.Context, guide *Guide)
- func IncrementModViews(ctx context.Context, mod *Mod)
- func IncrementVersionDownloads(ctx context.Context, version *Version)
- func InitializePostgres(ctx context.Context)
- func LogoutSession(ctx context.Context, token string)
- func NewModQuery(ctx context.Context, filter *models.ModFilter, unapproved bool, count bool) *gorm.DB
- func RemoveGuideTag(ctx context.Context, guideID string, tagID string) error
- func RemoveModTag(ctx context.Context, modID string, tagID string) error
- func ResetGuideTags(ctx context.Context, guideID string, tagIDs []string) error
- func ResetModTags(ctx context.Context, modID string, tagIDs []string) error
- func Save(ctx context.Context, object interface{})
- func SetGuideTags(ctx context.Context, guideID string, tagIDs []string) error
- func SetModTags(ctx context.Context, modID string, tagIDs []string) error
- func UserCanUploadModVersions(ctx context.Context, user *User, modID string) bool
- func ValidateTagName(tag string) error
- type Announcement
- func CreateAnnouncement(ctx context.Context, announcement *Announcement) (*Announcement, error)
- func GetAnnouncementByID(ctx context.Context, announcementID string) *Announcement
- func GetAnnouncements(ctx context.Context) []Announcement
- func GetAnnouncementsByImportance(ctx context.Context, importance string) []Announcement
- type BootstrapVersion
- func CreateBootstrapVersion(ctx context.Context, bootstrapVersion *BootstrapVersion) (*BootstrapVersion, error)
- func GetBootstrapVersionByID(ctx context.Context, bootstrapVersionID string) *BootstrapVersion
- func GetBootstrapVersions(ctx context.Context, filter *models.BootstrapVersionFilter) []BootstrapVersion
- func GetBootstrapVersionsByID(ctx context.Context, bootstrapVersionIds []string) []BootstrapVersion
- type Compatibility
- type CompatibilityInfo
- type ContextDB
- type GormLogger
- func (*GormLogger) Error(ctx context.Context, msg string, data ...interface{})
- func (*GormLogger) Info(ctx context.Context, msg string, data ...interface{})
- func (l *GormLogger) LogMode(mode logger.LogLevel) logger.Interface
- func (l *GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (*GormLogger) Warn(ctx context.Context, msg string, data ...interface{})
- type Guide
- func CreateGuide(ctx context.Context, guide *Guide) (*Guide, error)
- func GetGuideByID(ctx context.Context, guideID string) *Guide
- func GetGuideByIDNoCache(ctx context.Context, guideID string) *Guide
- func GetGuides(ctx context.Context, filter *models.GuideFilter) []Guide
- func GetGuidesByID(ctx context.Context, guideIds []string) []Guide
- func GetUserGuides(ctx context.Context, userID string) []Guide
- type GuideTag
- type Mod
- func CreateMod(ctx context.Context, mod *Mod) (*Mod, error)
- func GetModByID(ctx context.Context, modID string) *Mod
- func GetModByIDNoCache(ctx context.Context, modID string) *Mod
- func GetModByIDOrReference(ctx context.Context, modIDOrReference string) *Mod
- func GetModByReference(ctx context.Context, modReference string) *Mod
- func GetMods(ctx context.Context, limit int, offset int, orderBy string, order string, ...) []Mod
- func GetModsByID(ctx context.Context, modIds []string) []Mod
- func GetModsByIDOrReference(ctx context.Context, modIDOrReferences []string) []Mod
- func GetModsNew(ctx context.Context, filter *models.ModFilter, unapproved bool) []Mod
- type ModTag
- type SMLVersion
- func CreateSMLVersion(ctx context.Context, smlVersion *SMLVersion) (*SMLVersion, error)
- func GetSMLVersionByID(ctx context.Context, smlVersionID string) *SMLVersion
- func GetSMLVersions(ctx context.Context, filter *models.SMLVersionFilter) []SMLVersion
- func GetSMLVersionsByID(ctx context.Context, smlVersionIds []string) []SMLVersion
- type SMRDates
- type SMRModel
- type Tag
- type User
- type UserGroup
- type UserKey
- type UserMod
- type UserSession
- type Version
- func GetModVersion(ctx context.Context, modID string, versionID string) *Version
- func GetModVersionByName(ctx context.Context, modID string, versionName string) *Version
- func GetModVersions(ctx context.Context, modID string, limit int, offset int, orderBy string, ...) []Version
- func GetModVersionsConstraint(ctx context.Context, modID string, constraint string) []Version
- func GetModVersionsNew(ctx context.Context, modID string, filter *models.VersionFilter, ...) []Version
- func GetVersion(ctx context.Context, versionID string) *Version
- func GetVersionsByID(ctx context.Context, versionIds []string) []Version
- func GetVersionsNew(ctx context.Context, filter *models.VersionFilter, unapproved bool) []Version
- type VersionDependency
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddGuideTag ¶ added in v1.1.0
func ClearGuideTags ¶ added in v1.1.0
func DeleteForced ¶
func GetBootstrapVersionCount ¶
func GetBootstrapVersionCount(ctx context.Context, filter *models.BootstrapVersionFilter) int64
func GetGuideCount ¶
func GetGuideCount(ctx context.Context, filter *models.GuideFilter) int64
func GetModCountNew ¶
func GetModLatestVersions ¶
func GetModsLatestVersions ¶
func GetSMLLatestVersions ¶
func GetSMLLatestVersions(ctx context.Context) *[]SMLVersion
func GetSMLVersionCount ¶
func GetSMLVersionCount(ctx context.Context, filter *models.SMLVersionFilter) int64
func GetUserSession ¶
func GetVersionCountNew ¶
func IncrementGuideViews ¶
func IncrementModViews ¶
func InitializePostgres ¶
func LogoutSession ¶
func NewModQuery ¶
func RemoveGuideTag ¶ added in v1.1.0
func RemoveModTag ¶ added in v1.1.0
func ResetGuideTags ¶ added in v1.1.0
func ResetModTags ¶ added in v1.1.0
func SetGuideTags ¶ added in v1.1.0
func SetModTags ¶ added in v1.1.0
func ValidateTagName ¶ added in v1.1.0
Types ¶
type Announcement ¶
func CreateAnnouncement ¶
func CreateAnnouncement(ctx context.Context, announcement *Announcement) (*Announcement, error)
func GetAnnouncementByID ¶
func GetAnnouncementByID(ctx context.Context, announcementID string) *Announcement
func GetAnnouncements ¶
func GetAnnouncements(ctx context.Context) []Announcement
func GetAnnouncementsByImportance ¶
func GetAnnouncementsByImportance(ctx context.Context, importance string) []Announcement
type BootstrapVersion ¶
type BootstrapVersion struct { SMRModel Version string `gorm:"type:varchar(32);unique_index"` SatisfactoryVersion int Stability string `sql:"type:version_stability"` Date time.Time Link string Changelog string }
func CreateBootstrapVersion ¶
func CreateBootstrapVersion(ctx context.Context, bootstrapVersion *BootstrapVersion) (*BootstrapVersion, error)
func GetBootstrapVersionByID ¶
func GetBootstrapVersionByID(ctx context.Context, bootstrapVersionID string) *BootstrapVersion
func GetBootstrapVersions ¶
func GetBootstrapVersions(ctx context.Context, filter *models.BootstrapVersionFilter) []BootstrapVersion
func GetBootstrapVersionsByID ¶
func GetBootstrapVersionsByID(ctx context.Context, bootstrapVersionIds []string) []BootstrapVersion
type Compatibility ¶ added in v1.1.0
type CompatibilityInfo ¶ added in v1.1.0
type CompatibilityInfo struct { EA Compatibility `gorm:"type:compatibility"` EXP Compatibility `gorm:"type:compatibility"` }
type GormLogger ¶
func (*GormLogger) Error ¶
func (*GormLogger) Error(ctx context.Context, msg string, data ...interface{})
func (*GormLogger) Info ¶
func (*GormLogger) Info(ctx context.Context, msg string, data ...interface{})
type Guide ¶
type Guide struct { SMRModel Name string `gorm:"type:varchar(50)"` ShortDescription string `gorm:"type:varchar(128)"` Guide string Views uint Tags []Tag `gorm:"many2many:guide_tags"` UserID string User User }
func GetGuideByIDNoCache ¶ added in v1.1.0
type Mod ¶
type Mod struct { SMRModel Name string `gorm:"type:varchar(32)"` ShortDescription string `gorm:"type:varchar(128)"` FullDescription string Logo string SourceURL string CreatorID string Approved bool `gorm:"default:false;not null"` Denied bool `gorm:"default:false;not null"` Views uint Downloads uint Hotness uint Popularity uint LastVersionDate *time.Time ModReference string Hidden bool Compatibility *CompatibilityInfo `gorm:"serializer:json"` Users []User `gorm:"many2many:user_mods;"` Tags []Tag `gorm:"many2many:mod_tags"` Versions []Version }
func GetModByIDNoCache ¶ added in v1.1.0
func GetModByIDOrReference ¶
func GetModsByIDOrReference ¶ added in v1.0.6
type SMLVersion ¶
type SMLVersion struct { SMRModel Version string `gorm:"type:varchar(32);unique_index"` SatisfactoryVersion int Stability string `sql:"type:version_stability"` Date time.Time Link string Changelog string BootstrapVersion *string }
func CreateSMLVersion ¶
func CreateSMLVersion(ctx context.Context, smlVersion *SMLVersion) (*SMLVersion, error)
func GetSMLVersionByID ¶
func GetSMLVersionByID(ctx context.Context, smlVersionID string) *SMLVersion
func GetSMLVersions ¶
func GetSMLVersions(ctx context.Context, filter *models.SMLVersionFilter) []SMLVersion
func GetSMLVersionsByID ¶
func GetSMLVersionsByID(ctx context.Context, smlVersionIds []string) []SMLVersion
type Tag ¶ added in v1.1.0
type Tag struct { SMRModel Name string `gorm:"type:varchar(24)"` Mods []Mod `gorm:"many2many:mod_tags"` }
type User ¶
type UserMod ¶
type UserSession ¶
type Version ¶
type Version struct { SMRModel ModID string Version string `gorm:"type:varchar(16)"` SMLVersion string `gorm:"type:varchar(16)"` Changelog string Downloads uint Key string Stability string `gorm:"default:'alpha'" sql:"type:version_stability"` Approved bool `gorm:"default:false;not null"` Denied bool `gorm:"default:false;not null"` Hotness uint Metadata *string ModReference *string VersionMajor *int VersionMinor *int VersionPatch *int Size *int64 Hash *string }
If updated, update dataloader
func GetModVersion ¶
func GetModVersionByName ¶
func GetModVersions ¶
func GetModVersionsConstraint ¶ added in v1.0.6
func GetModVersionsNew ¶
func GetVersionsNew ¶
type VersionDependency ¶
type VersionDependency struct { SMRDates VersionID string `gorm:"primary_key;type:varchar(14)"` ModID string `gorm:"primary_key;type:varchar(14)"` Condition string `gorm:"type:varchar(64)"` Optional bool }
func GetVersionDependencies ¶
func GetVersionDependencies(ctx context.Context, versionID string) []VersionDependency
Source Files ¶
Click to show internal directories.
Click to hide internal directories.