Documentation
¶
Index ¶
- Constants
- Variables
- type Authors
- type Categories
- type CurseforgeAPIError
- type CurseforgeAPIResponse
- type Dependencies
- type Dependency
- type File
- type FileReleaseType
- type FileStatus
- type Files
- type GameVersion
- type GameVersionType
- type GameVersions
- type GameVersionsResponse
- type GetCategoriesResponse
- type GetModFilesResponse
- type HashAlgo
- type Hashes
- type LatestEarlyAccessFilesIndexes
- type LatestFilesIndexes
- type Links
- type Logo
- type ModData
- type ModLoaderDetailsResponse
- type ModStatus
- type ModloaderDetails
- type ModsResponse
- type Modules
- type Pagination
- type RawResponse
- type RelationType
- type Screenshots
- type SortableGameVersions
- type StringResponse
Constants ¶
View Source
const ( ErrAPIBadRequestMsg = "api returned bad request" ErrRequestErrorMsg = "could not make request" ErrAPIServerErrorMsg = "server error" ErrInvalidRequestParamsMsg = "invalid request params" )
View Source
const ( FileStatusProcessing = 1 FileStatusChangesRequired = 2 FileStatusUnderReview = 3 FileStatusApproved = 4 FileStatusRejected = 5 FileStatusMalwareDetected = 6 FileStatusDeleted = 7 FileStatusArchived = 8 FileStatusTesting = 9 FileStatusReleased = 10 FileStatusReadyForReview = 11 FileStatusDeprecated = 12 FileStatusBaking = 13 FileStatusAwaitingPublishing = 14 FileStatusFailedPublishing = 15 )
Variables ¶
View Source
var ( ErrAPIBadRequest error = Wrap(nil, ErrAPIBadRequestMsg, 400) ErrAPIServerError error = Wrap(nil, ErrAPIServerErrorMsg, 500) ErrRequestError error = Wrap(nil, ErrRequestErrorMsg, 0) ErrInvalidRequestParams error = Wrap(nil, ErrInvalidRequestParamsMsg, 0) )
Functions ¶
This section is empty.
Types ¶
type Categories ¶
type Categories struct {
ID int64 `json:"id"`
GameID int64 `json:"gameId"`
Name string `json:"name"`
Slug string `json:"slug"`
URL string `json:"url"`
IconURL string `json:"iconUrl"`
DateModified time.Time `json:"dateModified"`
IsClass bool `json:"isClass"`
ClassID int64 `json:"classId"`
ParentCategoryID int64 `json:"parentCategoryId"`
DisplayIndex int64 `json:"displayIndex"`
}
type CurseforgeAPIError ¶
type CurseforgeAPIError struct {
Status int
Message string
Err error
// contains filtered or unexported fields
}
func (CurseforgeAPIError) Error ¶
func (e CurseforgeAPIError) Error() string
func (CurseforgeAPIError) Is ¶
func (e CurseforgeAPIError) Is(err error) bool
type CurseforgeAPIResponse ¶
type CurseforgeAPIResponse interface {
SetRawResponseBody(resp string)
}
type Dependencies ¶
type Dependencies []Dependency
func (Dependencies) ModIDList ¶
func (d Dependencies) ModIDList() []int64
func (Dependencies) ModIDListByDependencyType ¶
func (d Dependencies) ModIDListByDependencyType(dt RelationType) []int64
type Dependency ¶
type Dependency struct {
ModID int64 `json:"modId"`
RelationType RelationType `json:"relationType"`
}
type File ¶
type File struct {
ID int `json:"id"`
GameID int `json:"gameId"`
ModID int `json:"modId"`
IsAvailable bool `json:"isAvailable"`
DisplayName string `json:"displayName"`
FileName string `json:"fileName"`
ReleaseType int `json:"releaseType"`
FileStatus int `json:"fileStatus"`
Hashes []Hashes `json:"hashes"`
FileDate time.Time `json:"fileDate"`
FileLength int `json:"fileLength"`
DownloadCount int `json:"downloadCount"`
FileSizeOnDisk int `json:"fileSizeOnDisk"`
DownloadURL string `json:"downloadUrl"`
GameVersions []string `json:"gameVersions"`
SortableGameVersions []SortableGameVersions `json:"sortableGameVersions"`
Dependencies Dependencies `json:"dependencies"`
ExposeAsAlternative bool `json:"exposeAsAlternative"`
ParentProjectFileID int `json:"parentProjectFileId"`
AlternateFileID int `json:"alternateFileId"`
IsServerPack bool `json:"isServerPack"`
ServerPackFileID int `json:"serverPackFileId"`
IsEarlyAccessContent bool `json:"isEarlyAccessContent"`
EarlyAccessEndDate time.Time `json:"earlyAccessEndDate"`
FileFingerprint int `json:"fileFingerprint"`
Modules []Modules `json:"modules"`
}
func (*File) GetDependencyModIDList ¶
func (f *File) GetDependencyModIDList() []Dependency
func (*File) IsCompatible ¶
type FileReleaseType ¶
type FileReleaseType int
const ( FileReleaseTypeRelease FileReleaseType = 1 FileReleaseTypeBeta FileReleaseType = 2 FileReleaseTypeAlpha FileReleaseType = 3 )
func (FileReleaseType) String ¶
func (f FileReleaseType) String() string
type FileStatus ¶
type FileStatus int
func (FileStatus) String ¶
func (f FileStatus) String() string
type GameVersion ¶
type GameVersionType ¶
type GameVersionType struct {
Type int `json:"type"`
Versions GameVersions `json:"versions"`
}
type GameVersions ¶
type GameVersions []GameVersion
func (GameVersions) Sort ¶
func (v GameVersions) Sort() GameVersions
type GameVersionsResponse ¶
type GameVersionsResponse struct {
RawResponse
Data []GameVersionType `json:"data"`
}
type GetCategoriesResponse ¶
type GetCategoriesResponse struct {
RawResponse
Data []Categories `json:"data"`
}
type GetModFilesResponse ¶
type GetModFilesResponse struct {
RawResponse
Data Files `json:"data"`
Pagination Pagination `json:"pagination"`
}
type LatestFilesIndexes ¶
type ModData ¶
type ModData struct {
ID int64 `json:"id"`
GameID int `json:"gameId"`
Name string `json:"name"`
Slug string `json:"slug"`
Links Links `json:"links"`
Summary string `json:"summary"`
Status ModStatus `json:"status"`
DownloadCount int `json:"downloadCount"`
IsFeatured bool `json:"isFeatured"`
PrimaryCategoryID int `json:"primaryCategoryId"`
Categories []Categories `json:"categories"`
ClassID int `json:"classId"`
Authors []Authors `json:"authors"`
Logo Logo `json:"logo"`
Screenshots []Screenshots `json:"screenshots"`
MainFileID int `json:"mainFileId"`
LatestFiles Files `json:"latestFiles"`
LatestFilesIndexes []LatestFilesIndexes `json:"latestFilesIndexes"`
LatestEarlyAccessFilesIndexes []LatestEarlyAccessFilesIndexes `json:"latestEarlyAccessFilesIndexes"`
DateCreated time.Time `json:"dateCreated"`
DateModified time.Time `json:"dateModified"`
DateReleased time.Time `json:"dateReleased"`
AllowModDistribution bool `json:"allowModDistribution"`
GamePopularityRank int64 `json:"gamePopularityRank"`
IsAvailable bool `json:"isAvailable"`
ThumbsUpCount int64 `json:"thumbsUpCount"`
Rating int64 `json:"rating"`
}
func (*ModData) GetLatestFile ¶
func (*ModData) GetLatestFileByGameVersion ¶
func (*ModData) GetLatestFileByGameVersionsAndModloader ¶
func (*ModData) GetLatestFileGameVersions ¶
type ModLoaderDetailsResponse ¶
type ModLoaderDetailsResponse struct {
RawResponse
Data ModloaderDetails `json:"data"`
}
type ModStatus ¶
type ModStatus int
const ( ModStatusNew ModStatus = 1 ModStatusChangesRequired ModStatus = 2 ModStatusUnderSoftReview ModStatus = 3 ModStatusApproved ModStatus = 4 ModStatusRejected ModStatus = 5 ModStatusChangesMade ModStatus = 6 ModStatusInactive ModStatus = 7 ModStatusAbandoned ModStatus = 8 ModStatusDeleted ModStatus = 9 ModStatusUnderReview ModStatus = 10 )
type ModloaderDetails ¶
type ModloaderDetails struct {
ID int `json:"id"`
GameVersionID int `json:"gameVersionId"`
MinecraftGameVersionID int `json:"minecraftGameVersionId"`
ForgeVersion string `json:"forgeVersion"`
Name string `json:"name"`
Type int `json:"type"`
DownloadURL string `json:"downloadUrl"`
Filename string `json:"filename"`
InstallMethod int `json:"installMethod"`
Latest bool `json:"latest"`
Recommended bool `json:"recommended"`
Approved bool `json:"approved"`
DateModified time.Time `json:"dateModified"`
MavenVersionString string `json:"mavenVersionString"`
VersionJSON string `json:"versionJson"`
LibrariesInstallLocation string `json:"librariesInstallLocation"`
MinecraftVersion string `json:"minecraftVersion"`
AdditionalFilesJSON string `json:"additionalFilesJson"`
ModLoaderGameVersionID int `json:"modLoaderGameVersionId"`
ModLoaderGameVersionTypeID int `json:"modLoaderGameVersionTypeId"`
ModLoaderGameVersionStatus int `json:"modLoaderGameVersionStatus"`
ModLoaderGameVersionTypeStatus int `json:"modLoaderGameVersionTypeStatus"`
McGameVersionID int `json:"mcGameVersionId"`
McGameVersionTypeID int `json:"mcGameVersionTypeId"`
McGameVersionStatus int `json:"mcGameVersionStatus"`
McGameVersionTypeStatus int `json:"mcGameVersionTypeStatus"`
InstallProfileJSON string `json:"installProfileJson"`
}
type ModsResponse ¶
type ModsResponse struct {
RawResponse
Data []ModData `json:"data"`
Pagination Pagination `json:"pagination"`
}
type Pagination ¶
type RawResponse ¶
type RawResponse struct {
CurseforgeAPIResponse
RawBody string `json:"body"`
}
func (*RawResponse) SetRawResponseBody ¶
func (r *RawResponse) SetRawResponseBody(resp string)
type RelationType ¶
type RelationType int
const ( RelationTypeEmbeddedLibrary RelationType = 1 RelationTypeOptionalDependency RelationType = 2 RelationTypeRequiredDependency RelationType = 3 RelationTypeTool RelationType = 4 RelationTypeIncompatible RelationType = 5 RelationTypeInclude RelationType = 6 )
func (RelationType) String ¶
func (r RelationType) String() string
type Screenshots ¶
type SortableGameVersions ¶
type StringResponse ¶
type StringResponse struct {
RawResponse
Data string `json:"data"`
}
Click to show internal directories.
Click to hide internal directories.