Documentation
¶
Index ¶
- Variables
- func CollectionByID(db *gorm.DB, id int64) *itchio.Collection
- func CollectionExt(c *itchio.Collection) collectionExt
- func DownloadMaxPosition(db *gorm.DB) int64
- func DownloadMinPosition(db *gorm.DB) int64
- func GameByID(db *gorm.DB, id int64) *itchio.Game
- func HadesContext(db *gorm.DB) *hades.Context
- func MarshalVerdict(in *configurator.Verdict, out *JSON) error
- func MustPreload(db *gorm.DB, params *hades.PreloadParams) error
- func MustPreloadSimple(db *gorm.DB, record interface{}, fields ...string)
- func Preload(db *gorm.DB, params *hades.PreloadParams) error
- func PreloadCaves(db *gorm.DB, caveOrCaves interface{})
- func PreloadDownloads(db *gorm.DB, downloadOrDownloads interface{})
- func PreloadSimple(db *gorm.DB, record interface{}, fields ...string) error
- func UnmarshalVerdict(in JSON) (*configurator.Verdict, error)
- type Cave
- func (c *Cave) GetInstallFolder(db *gorm.DB) string
- func (c *Cave) GetInstallLocation(db *gorm.DB) *InstallLocation
- func (c *Cave) GetVerdict() *configurator.Verdict
- func (c *Cave) Preload(db *gorm.DB)
- func (c *Cave) RecordPlayTime(playTime time.Duration)
- func (c *Cave) Save(db *gorm.DB)
- func (c *Cave) SetVerdict(verdict *configurator.Verdict)
- func (c *Cave) Touch()
- func (c *Cave) UpdateInstallTime()
- type Download
- type DownloadKey
- type InstallLocation
- type JSON
- type Profile
- type ProfileCollection
- type ProfileData
- type ProfileGame
Constants ¶
This section is empty.
Variables ¶
View Source
var AllModels = []interface{}{ &Profile{}, &ProfileCollection{}, &itchio.DownloadKey{}, &itchio.Collection{}, &itchio.CollectionGame{}, &ProfileGame{}, &itchio.Game{}, &itchio.User{}, &Download{}, &Cave{}, &itchio.GameEmbedData{}, &itchio.Sale{}, &InstallLocation{}, &itchio.Upload{}, &itchio.Build{}, &ProfileData{}, }
AllModels contains all the tables contained in butler's database
Functions ¶
func CollectionByID ¶
func CollectionByID(db *gorm.DB, id int64) *itchio.Collection
func CollectionExt ¶
func CollectionExt(c *itchio.Collection) collectionExt
func DownloadMaxPosition ¶
func DownloadMinPosition ¶
func MarshalVerdict ¶
func MarshalVerdict(in *configurator.Verdict, out *JSON) error
func MustPreload ¶
func MustPreload(db *gorm.DB, params *hades.PreloadParams) error
func MustPreloadSimple ¶
func PreloadCaves ¶
func PreloadDownloads ¶
func UnmarshalVerdict ¶
func UnmarshalVerdict(in JSON) (*configurator.Verdict, error)
Types ¶
type Cave ¶
type Cave struct {
ID string `json:"id"`
GameID int64 `json:"gameId"`
Game *itchio.Game `json:"game"`
ExternalGameID int64 `json:"externalGameId"`
UploadID int64 `json:"uploadId"`
Upload *itchio.Upload `json:"upload"`
BuildID int64 `json:"buildId"`
Build *itchio.Build `json:"build"`
Morphing bool `json:"morphing"`
InstalledAt *time.Time `json:"installedAt"`
LastTouchedAt *time.Time `json:"lastTouchedAt"`
SecondsRun int64 `json:"secondsRun"`
Verdict JSON `json:"verdict"`
InstalledSize int64 `json:"installedSize"`
InstallLocationID string `json:"installLocationId"`
InstallLocation *InstallLocation `json:"installLocation"`
InstallFolderName string `json:"installFolderName"`
// If set, InstallLocationID is empty and this is used
// for all operations instead
CustomInstallFolder string `json:"customInstallFolder"`
}
func (*Cave) GetInstallLocation ¶
func (c *Cave) GetInstallLocation(db *gorm.DB) *InstallLocation
func (*Cave) GetVerdict ¶
func (c *Cave) GetVerdict() *configurator.Verdict
func (*Cave) RecordPlayTime ¶
func (*Cave) SetVerdict ¶
func (c *Cave) SetVerdict(verdict *configurator.Verdict)
func (*Cave) UpdateInstallTime ¶
func (c *Cave) UpdateInstallTime()
type Download ¶
type Download struct {
// An UUID
ID string `json:"id" gorm:"primary_key"`
Reason string `json:"reason"`
Position int64 `json:"position"`
StartedAt *time.Time `json:"startedAt"`
FinishedAt *time.Time `json:"finishedAt"`
Error *string `json:"error"`
CaveID string `json:"caveId"`
GameID int64 `json:"gameId"`
Game *itchio.Game `json:"game"`
UploadID int64 `json:"uploadId"`
Upload *itchio.Upload `json:"upload"`
BuildID int64 `json:"buildId"`
Build *itchio.Build `json:"build"`
StagingFolder string `json:"stagingFolder"`
InstallFolder string `json:"installFolder"`
Discarded bool `json:"discarded"`
Fresh bool `json:"fresh"`
}
func AllDownloads ¶
type DownloadKey ¶
type DownloadKey struct {
ID int64 `json:"id"`
GameID int64 `json:"gameId"`
Game *itchio.Game `json:"game,omitempty"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
OwnerID int64 `json:"ownerId"`
Owner *itchio.User `json:"owner,omitempty"`
}
func DownloadKeysByGameID ¶
func DownloadKeysByGameID(db *gorm.DB, gameID int64) []*DownloadKey
type InstallLocation ¶
type InstallLocation struct {
ID string `json:"id" gorm:"primary_key"`
Path string `json:"path"`
Caves []*Cave `json:"caves"`
}
func InstallLocationByID ¶
func InstallLocationByID(db *gorm.DB, id string) *InstallLocation
func (*InstallLocation) GetInstallFolder ¶
func (il *InstallLocation) GetInstallFolder(folderName string) string
func (*InstallLocation) GetStagingFolder ¶
func (il *InstallLocation) GetStagingFolder(installID string) string
type Profile ¶
type Profile struct {
ID int64 `json:"id"`
APIKey string `json:"apiKey"`
LastConnected time.Time `json:"lastConnected"`
User *itchio.User `json:"user"`
UserID int64 `json:"userId"`
Developer bool `json:"developer"`
PressUser bool `json:"pressUser"`
ProfileCollections []*ProfileCollection `json:"profileCollections,omitempty"`
ProfileGames []*ProfileGame `json:"profileGames,omitempty"`
OwnedKeys []*itchio.DownloadKey `json:"ownedKeys,omitempty" gorm:"foreignKey:owner_id"`
}
func AllProfiles ¶
func (*Profile) UpdateFromUser ¶
type ProfileCollection ¶
type ProfileData ¶
type ProfileGame ¶
type ProfileGame struct {
GameID int64 `json:"gameId" gorm:"primary_key;auto_increment:false"`
Game *itchio.Game `json:"game,omitempty"`
// ID of the profile this game is associated with - they're
// not necessarily the original owner, they just have admin
// access to it.
ProfileID int64 `json:"profileId" gorm:"primary_key;auto_increment:false"`
Profile *Profile `json:"profile,omitempty"`
Position int64 `json:"position"`
ViewsCount int64 `json:"viewsCount"`
DownloadsCount int64 `json:"downloadsCount"`
PurchasesCount int64 `json:"purchasesCount"`
Published bool `json:"published"`
}
Join table for Profile <has many> Games
func ProfileGamesByGameID ¶
func ProfileGamesByGameID(db *gorm.DB, gameID int64) []*ProfileGame
Click to show internal directories.
Click to hide internal directories.