Documentation ¶
Index ¶
- Constants
- func Bool(v bool) *bool
- func CheckResponse(r *http.Response) error
- func String(v string) *string
- func UInt32(v uint32) *uint32
- func UInt64(v uint64) *uint64
- type CategoryTag
- type Client
- type Dependency
- type DonationPlatformTag
- type DonationURL
- type ErrorResponse
- type File
- type GalleryImage
- type GalleryImageOptions
- type GameVersionTag
- type Licence
- type LicenceTag
- type ListVersionsOptions
- type LoaderTag
- type MiscellaneousService
- type ModeratorMessage
- type ModifyProjectOptions
- type ModifyUserOptions
- type ModifyVersionOptions
- type NotFoundErrorResponse
- type Notification
- type Project
- type ProjectDependencies
- type ProjectsService
- func (s *ProjectsService) Delete(idOrSlug string) error
- func (s *ProjectsService) DeleteGalleryImage(idOrSlug string, url string) error
- func (s *ProjectsService) Follow(idOrSlug string) error
- func (s *ProjectsService) Get(idOrSlug string) (*Project, error)
- func (s *ProjectsService) GetDependencies(idOrSlug string) (*ProjectDependencies, error)
- func (s *ProjectsService) GetMultiple(ids []string) ([]*Project, error)
- func (s *ProjectsService) Modify(idOrSlug string, options ModifyProjectOptions) error
- func (s *ProjectsService) ModifyGalleryImage(idOrSlug string, url string, options *GalleryImageOptions) error
- func (s *ProjectsService) Search(options *SearchOptions) (*SearchResponse, error)
- func (s *ProjectsService) Unfollow(idOrSlug string) error
- type Report
- type SearchOptions
- type SearchResponse
- type SearchResult
- type Statistics
- type TagsService
- func (s *TagsService) GetCategories() ([]*CategoryTag, error)
- func (s *TagsService) GetDonationPlatforms() ([]*DonationPlatformTag, error)
- func (s *TagsService) GetGameVersions() ([]*GameVersionTag, error)
- func (s *TagsService) GetLicences() ([]*LicenceTag, error)
- func (s *TagsService) GetLoaders() ([]*LoaderTag, error)
- func (s *TagsService) GetReportTypes() ([]string, error)
- type TeamMember
- type TeamsService
- func (s *TeamsService) AddMember(teamID string, userID string) error
- func (s *TeamsService) Get(id string) ([]*TeamMember, error)
- func (s *TeamsService) GetMultiple(ids []string) ([][]*TeamMember, error)
- func (s *TeamsService) GetProjectTeam(idOrSlug string) ([]*TeamMember, error)
- func (s *TeamsService) Join(id string) error
- func (s *TeamsService) RemoveMember(teamID string, userIDOrUsername string) error
- func (s *TeamsService) TransferOwnership(teamID string, userID string) error
- type User
- type UsersService
- func (s *UsersService) Delete(idOrUsername string) error
- func (s *UsersService) Get(idOrUsername string) (*User, error)
- func (s *UsersService) GetFollowedProjects(idOrUsername string) ([]*Project, error)
- func (s *UsersService) GetFromAuthHeader() (*User, error)
- func (s *UsersService) GetMultiple(idOrUsernames []string) ([]*User, error)
- func (s *UsersService) GetNotifications(idOrUsername string) ([]*Notification, error)
- func (s *UsersService) GetProjects(idOrUsername string) ([]*Project, error)
- func (s *UsersService) Modify(idOrUsername string, options ModifyUserOptions) error
- type Version
- type VersionFilesService
- func (s *VersionFilesService) DeleteFromHash(hash string, algorithm string) error
- func (s *VersionFilesService) GetFromHash(hash string, algorithm string) (*Version, error)
- func (s *VersionFilesService) GetFromHashes(hashes []string, algorithm string) (map[string]*Version, error)
- func (s *VersionFilesService) GetLatestVersionFromHash(hash string, algorithm string, loaders []string, gameVersions []string) (*Version, error)
- func (s *VersionFilesService) GetLatestVersionsFromHashes(hashes []string, algorithm string, loaders []string, gameVersions []string) (map[string]*Version, error)
- type VersionsService
- func (s *VersionsService) Delete(idOrSlug string) error
- func (s *VersionsService) Get(idOrSlug string) (*Version, error)
- func (s *VersionsService) GetMultiple(ids []string) ([]*Version, error)
- func (s *VersionsService) ListVersions(projectIDOrSlug string, options ListVersionsOptions) ([]*Version, error)
- func (s *VersionsService) Modify(id string, options ModifyVersionOptions) error
Constants ¶
const ( // SearchFacetCategories filters by project's categories. SearchFacetCategories = "categories" // SearchFacetVersions filters by Minecraft version. SearchFacetVersions = "versions" // SearchFacetLicence filters by project's licence. SearchFacetLicence = "license" // SearchFacetProjectType filters by project's type. SearchFacetProjectType = "project_type" )
const ( // SearchIndexRelevance sorts search results by Modrinth's assessment of relevance. SearchIndexRelevance = "relevance" // SearchIndexDownloads sorts search results by the order of downloads. SearchIndexDownloads = "downloads" // SearchIndexFollows sorts search results by the order of project followers. SearchIndexFollows = "follows" // SearchIndexNewest sorts search results by the newest projects. SearchIndexNewest = "newest" // SearchIndexUpdated sorts search results by the latest updated projects. SearchIndexUpdated = "updated" )
const ( // SideRequired indicates that the project is required on the side. SideRequired = "required" // SideOptional indicates that the project is optional on the side. SideOptional = "optional" // SideUnsupported indicates that the project is unsupported on the side. SideUnsupported = "unsupported" )
Variables ¶
This section is empty.
Functions ¶
func CheckResponse ¶
Types ¶
type CategoryTag ¶ added in v0.1.1
type Client ¶
type Client struct { // Base URL for API requests. BaseURL should always be set with a // trailing slash. BaseURL *url.URL // User Agent used when communicating with the Modrinth API. UserAgent string // Token used for authorisation with the Modrinth API. // // This is a GitHub token. Token string // Services used for accessing different parts of the Modrinth // API. Projects *ProjectsService Versions *VersionsService VersionFiles *VersionFilesService Users *UsersService Teams *TeamsService Tags *TagsService Misc *MiscellaneousService // contains filtered or unexported fields }
Client manages communication with the Modrinth API.
func NewClient ¶
NewClient returns a new Modrinth API client. If a nil client is provided, http.DefaultClient will be used.
func (*Client) Do ¶
Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v.
func (*Client) NewRequest ¶
NewRequest creates an API request. A relative URL can be provided in urlStr, in which case it is resolved to the BaseURL of the Client. Relative URLs should always be specified without a preceding slash. If specified, the value pointed to by the body is JSON encoded and included as the request body.
type Dependency ¶
type DonationPlatformTag ¶ added in v0.1.1
type DonationURL ¶ added in v0.5.0
type ErrorResponse ¶
type ErrorResponse struct { Response *http.Response ErrorType string `json:"error"` Description string `json:"description"` }
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
type GalleryImage ¶
type GalleryImageOptions ¶ added in v0.3.2
type GameVersionTag ¶ added in v0.1.1
type LicenceTag ¶ added in v0.1.1
type ListVersionsOptions ¶ added in v0.4.0
type MiscellaneousService ¶ added in v0.6.0
type MiscellaneousService service
MiscellaneousService handles communication with the miscellaneous routes of the Modrinth API.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/misc
func (*MiscellaneousService) GetStatistics ¶ added in v0.6.0
func (s *MiscellaneousService) GetStatistics() (*Statistics, error)
GetStatistics gets statistics for the Modrinth API.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/misc/operation/statistics
func (*MiscellaneousService) Report ¶ added in v0.6.0
func (s *MiscellaneousService) Report( reportType string, itemID string, itemType string, body string, ) (*Report, error)
Report reports a user.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/misc/operation/submitReport
type ModeratorMessage ¶ added in v0.3.0
type ModifyProjectOptions ¶ added in v0.6.0
type ModifyProjectOptions struct { Title *string `json:"title,omitempty"` Description *string `json:"description,omitempty"` Body *string `json:"body,omitempty"` Categories []string `json:"categories,omitempty"` IssuesURL *string `json:"issues_url,omitempty"` SourceURL *string `json:"source_url,omitempty"` WikiURL *string `json:"wiki_url,omitempty"` LicenceURL *string `json:"license_url,omitempty"` DiscordURL *string `json:"discord_url,omitempty"` DonationURLs []*DonationURL `json:"donation_urls,omitempty"` LicenceID *string `json:"license_id,omitempty"` ClientSide *string `json:"client_side,omitempty"` ServerSide *string `json:"server_side,omitempty"` Slug *string `json:"slug,omitempty"` Status *string `json:"status,omitempty"` ModerationMessage *string `json:"moderation_message,omitempty"` ModerationMessageBody *string `json:"moderation_message_body,omitempty"` }
type ModifyUserOptions ¶ added in v0.6.0
type ModifyVersionOptions ¶ added in v0.6.0
type ModifyVersionOptions struct { Name *string `json:"name,omitempty"` VersionNumber *string `json:"version_number,omitempty"` Changelog *string `json:"changelog,omitempty"` VersionType *string `json:"version_type,omitempty"` Dependencies []*Dependency `json:"dependencies,omitempty"` GameVersions []string `json:"game_versions,omitempty"` Loaders []string `json:"loaders,omitempty"` Featured *bool `json:"featured,omitempty"` PrimaryFile []string `json:"primary_file,omitempty"` }
type NotFoundErrorResponse ¶ added in v0.5.0
NotFoundErrorResponse occurs when Modrinth return a 404 Not Found response.
func (*NotFoundErrorResponse) Error ¶ added in v0.5.0
func (r *NotFoundErrorResponse) Error() string
type Notification ¶ added in v0.2.0
type Notification struct { ID *string `json:"id,omitempty"` UserID *string `json:"user_id,omitempty"` Type *string `json:"type,omitempty"` Title *string `json:"title,omitempty"` Text *string `json:"text,omitempty"` Link *string `json:"link,omitempty"` Read *bool `json:"read,omitempty"` Created *time.Time `json:"created,omitempty"` }
type Project ¶
type Project struct { Slug *string `json:"slug,omitempty"` Title *string `json:"title,omitempty"` Description *string `json:"description,omitempty"` Categories []string `json:"categories,omitempty"` AdditionalCategories []string `json:"additional_categories,omitempty"` ClientSide *string `json:"client_side,omitempty"` ServerSide *string `json:"server_side,omitempty"` Body *string `json:"body,omitempty"` IssuesURL *string `json:"issues_url,omitempty"` SourceURL *string `json:"source_url,omitempty"` WikiURL *string `json:"wiki_url,omitempty"` DiscordURL *string `json:"discord_url,omitempty"` DonationURLs []*DonationURL `json:"donation_urls,omitempty"` ProjectType *string `json:"project_type,omitempty"` Downloads *uint32 `json:"downloads,omitempty"` IconURL *string `json:"icon_url,omitempty"` Colour *uint32 `json:"color,omitempty"` ID *string `json:"id,omitempty"` Team *string `json:"team,omitempty"` BodyURL *string `json:"body_url,omitempty"` ModeratorMessage *ModeratorMessage `json:"moderator_message,omitempty"` Published *time.Time `json:"published,omitempty"` Updated *time.Time `json:"updated,omitempty"` Approved *time.Time `json:"approved,omitempty"` Followers *uint32 `json:"followers,omitempty"` Status *string `json:"status,omitempty"` Licence *Licence `json:"license,omitempty"` Versions []string `json:"versions,omitempty"` GameVersions []string `json:"game_versions,omitempty"` Loaders []string `json:"loaders,omitempty"` Gallery []*GalleryImage `json:"gallery,omitempty"` }
type ProjectDependencies ¶ added in v0.2.0
type ProjectsService ¶ added in v0.2.0
type ProjectsService service
ProjectsService handles communication with the projects routes of the Modrinth API.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/projects
func (*ProjectsService) Delete ¶ added in v0.2.0
func (s *ProjectsService) Delete(idOrSlug string) error
Delete deletes a project.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/projects/operation/deleteProject
func (*ProjectsService) DeleteGalleryImage ¶ added in v0.2.0
func (s *ProjectsService) DeleteGalleryImage(idOrSlug string, url string) error
DeleteGalleryImage deletes a gallery image from a project, based on its URL.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/projects/operation/deleteGalleryImage
func (*ProjectsService) Follow ¶ added in v0.3.4
func (s *ProjectsService) Follow(idOrSlug string) error
Follow causes the authenticated user to follow the project.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/projects/operation/followProject
func (*ProjectsService) Get ¶ added in v0.2.0
func (s *ProjectsService) Get(idOrSlug string) (*Project, error)
Get gets a project.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/projects/operation/getProject
func (*ProjectsService) GetDependencies ¶ added in v0.2.0
func (s *ProjectsService) GetDependencies(idOrSlug string) (*ProjectDependencies, error)
GetDependencies gets the project and version dependencies of a project.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/projects/operation/getDependencies
func (*ProjectsService) GetMultiple ¶ added in v0.3.2
func (s *ProjectsService) GetMultiple(ids []string) ([]*Project, error)
GetMultiple gets multiples projects.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/projects/operation/getProjects
func (*ProjectsService) Modify ¶ added in v0.3.4
func (s *ProjectsService) Modify(idOrSlug string, options ModifyProjectOptions) error
Modify modifies a project.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/projects/operation/modifyProject
func (*ProjectsService) ModifyGalleryImage ¶ added in v0.3.2
func (s *ProjectsService) ModifyGalleryImage(idOrSlug string, url string, options *GalleryImageOptions) error
ModifyGalleryImage modifies the name and description of a gallery image from a project, based on it's URL.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/projects/operation/modifyGalleryImage
func (*ProjectsService) Search ¶ added in v0.3.0
func (s *ProjectsService) Search(options *SearchOptions) (*SearchResponse, error)
Search searches all projects based on the criteria provided, and returns search results in a paginated response.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/projects/operation/searchProjects
func (*ProjectsService) Unfollow ¶ added in v0.3.4
func (s *ProjectsService) Unfollow(idOrSlug string) error
Unfollow causes the authenticated user to unfollow the project.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/projects/operation/unfollowProject
type SearchOptions ¶ added in v0.3.0
type SearchResponse ¶ added in v0.3.0
type SearchResponse struct { Hits []*SearchResult `json:"hits,omitempty"` Offset *uint32 `json:"offset,omitempty"` Limit *uint32 `json:"limit,omitempty"` TotalHits *uint32 `json:"total_hits,omitempty"` }
type SearchResult ¶
type SearchResult struct { Slug *string `json:"slug,omitempty"` Title *string `json:"title,omitempty"` Description *string `json:"description,omitempty"` Categories []string `json:"categories,omitempty"` ClientSide *string `json:"client_side,omitempty"` ServerSide *string `json:"server_side,omitempty"` ProjectType *string `json:"project_type,omitempty"` Downloads *uint32 `json:"downloads,omitempty"` IconURL *string `json:"icon_url,omitempty"` ProjectID *string `json:"project_id,omitempty"` Author *string `json:"author,omitempty"` Versions []string `json:"versions,omitempty"` Follows *uint32 `json:"follows,omitempty"` DateCreated *time.Time `json:"date_created,omitempty"` DateModified *time.Time `json:"date_modified,omitempty"` LatestVersion *string `json:"latest_version,omitempty"` Licence *string `json:"license,omitempty"` Gallery []string `json:"gallery,omitempty"` }
type Statistics ¶ added in v0.6.0
type TagsService ¶ added in v0.1.1
type TagsService service
TagsService handles communication with the tags routes of the Modrinth API.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/tags
func (*TagsService) GetCategories ¶ added in v0.1.1
func (s *TagsService) GetCategories() ([]*CategoryTag, error)
GetCategories gets all category tags available for usage.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/tags/operation/categoryList
func (*TagsService) GetDonationPlatforms ¶ added in v0.1.1
func (s *TagsService) GetDonationPlatforms() ([]*DonationPlatformTag, error)
GetDonationPlatforms gets all donation platform tags available for usage.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/tags/operation/donationPlatformList
func (*TagsService) GetGameVersions ¶ added in v0.1.1
func (s *TagsService) GetGameVersions() ([]*GameVersionTag, error)
GetGameVersions gets all game version tags available for usage.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/tags/operation/versionList
func (*TagsService) GetLicences ¶ added in v0.1.1
func (s *TagsService) GetLicences() ([]*LicenceTag, error)
GetLicences gets all licence tags available for usage.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/tags/operation/licenseList
func (*TagsService) GetLoaders ¶ added in v0.1.1
func (s *TagsService) GetLoaders() ([]*LoaderTag, error)
GetLoaders gets all loader tags available for usage.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/tags/operation/loaderList
func (*TagsService) GetReportTypes ¶ added in v0.1.1
func (s *TagsService) GetReportTypes() ([]string, error)
GetReportTypes gets all report type tags available for usage.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/tags/operation/reportTypeList
type TeamMember ¶
type TeamsService ¶ added in v0.1.1
type TeamsService service
TeamsService handles communication with the teams routes of the Modrinth API.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/teams
func (*TeamsService) AddMember ¶ added in v0.1.1
func (s *TeamsService) AddMember(teamID string, userID string) error
AddMember invites a user to a team.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/teams/operation/addTeamMember
func (*TeamsService) Get ¶ added in v0.1.1
func (s *TeamsService) Get(id string) ([]*TeamMember, error)
Get gets the team members from a team.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/teams/operation/getTeamMembers
func (*TeamsService) GetMultiple ¶ added in v0.5.0
func (s *TeamsService) GetMultiple(ids []string) ([][]*TeamMember, error)
GetMultiple gets multiples teams.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/teams/operation/getTeams
func (*TeamsService) GetProjectTeam ¶ added in v0.1.1
func (s *TeamsService) GetProjectTeam(idOrSlug string) ([]*TeamMember, error)
GetProjectTeam gets the team members from a project.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/teams/operation/getProjectTeamMembers
func (*TeamsService) Join ¶ added in v0.1.1
func (s *TeamsService) Join(id string) error
Join joins a team.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/teams/operation/joinTeam
func (*TeamsService) RemoveMember ¶ added in v0.1.1
func (s *TeamsService) RemoveMember(teamID string, userIDOrUsername string) error
RemoveMember removes a member from a team.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/teams/paths/~1team~1{team_id}~1members~1{user_id}/delete
func (*TeamsService) TransferOwnership ¶ added in v0.1.1
func (s *TeamsService) TransferOwnership(teamID string, userID string) error
TransferOwnership transfers ownership of a team to another user.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/teams/operation/transferTeamOwnership
type User ¶
type User struct { Username *string `json:"username,omitempty"` Name *string `json:"name,omitempty"` Email *string `json:"email,omitempty"` Bio *string `json:"bio,omitempty"` ID *string `json:"id,omitempty"` GitHubID *uint64 `json:"github_id,omitempty"` AvatarURL *string `json:"avatar_url,omitempty"` Created *time.Time `json:"created,omitempty"` Role *string `json:"role,omitempty"` }
type UsersService ¶
type UsersService service
UsersService handles communication with the users routes of the Modrinth API.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/users
func (*UsersService) Delete ¶ added in v0.1.1
func (s *UsersService) Delete(idOrUsername string) error
Delete deletes a user.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/users/operation/deleteUser
func (*UsersService) Get ¶
func (s *UsersService) Get(idOrUsername string) (*User, error)
Get gets a users.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/users/operation/getUser
func (*UsersService) GetFollowedProjects ¶ added in v0.3.0
func (s *UsersService) GetFollowedProjects(idOrUsername string) ([]*Project, error)
GetFollowedProjects gets all a user's followed projects.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/users/operation/getFollowedProjects
func (*UsersService) GetFromAuthHeader ¶ added in v0.4.0
func (s *UsersService) GetFromAuthHeader() (*User, error)
GetFromAuthHeader gets the currently authenticated user.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/users/operation/getUserFromAuth
func (*UsersService) GetMultiple ¶ added in v0.3.3
func (s *UsersService) GetMultiple(idOrUsernames []string) ([]*User, error)
GetMultiple gets multiple users.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/users/operation/getUsers
func (*UsersService) GetNotifications ¶ added in v0.3.0
func (s *UsersService) GetNotifications(idOrUsername string) ([]*Notification, error)
GetNotifications gets all a user's notifications.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/users/operation/getNotifications
func (*UsersService) GetProjects ¶ added in v0.3.0
func (s *UsersService) GetProjects(idOrUsername string) ([]*Project, error)
GetProjects gets all a user's projects.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/users/operation/getUserProjects
func (*UsersService) Modify ¶ added in v0.2.0
func (s *UsersService) Modify(idOrUsername string, options ModifyUserOptions) error
Modify modifies a user.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/users/operation/modifyUser
type Version ¶
type Version struct { Name *string `json:"name,omitempty"` VersionNumber *string `json:"version_number,omitempty"` Changelog *string `json:"changelog,omitempty"` Dependencies []*Dependency `json:"dependencies,omitempty"` GameVersions []string `json:"game_versions,omitempty"` VersionType *string `json:"version_type,omitempty"` Loaders []string `json:"loaders,omitempty"` Featured *bool `json:"featured,omitempty"` ID *string `json:"id,omitempty"` ProjectID *string `json:"project_id,omitempty"` AuthorID *string `json:"author_id,omitempty"` DatePublished *time.Time `json:"date_published,omitempty"` Downloads *uint32 `json:"downloads,omitempty"` ChangelogURL *string `json:"changelog_url,omitempty"` Files []*File `json:"files,omitempty"` }
type VersionFilesService ¶
type VersionFilesService service
VersionFilesService handles communication with the version files routes of the Modrinth API.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/version-files
func (*VersionFilesService) DeleteFromHash ¶ added in v0.1.1
func (s *VersionFilesService) DeleteFromHash(hash string, algorithm string) error
DeleteFromHash deletes a file from a version based on its hash.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/version-files/operation/deleteFileFromHash
func (*VersionFilesService) GetFromHash ¶
func (s *VersionFilesService) GetFromHash(hash string, algorithm string) (*Version, error)
GetFromHash gets a version from a file's hash.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/version-files/operation/versionFromHash
func (*VersionFilesService) GetFromHashes ¶ added in v0.1.1
func (s *VersionFilesService) GetFromHashes(hashes []string, algorithm string) (map[string]*Version, error)
GetFromHashes gets multiple versions from their file's hashes.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/version-files/operation/versionsFromHashes
func (*VersionFilesService) GetLatestVersionFromHash ¶ added in v0.1.1
func (s *VersionFilesService) GetLatestVersionFromHash( hash string, algorithm string, loaders []string, gameVersions []string, ) (*Version, error)
GetLatestVersionFromHash gets the latest version of a project, based on a hash of a project's version's file.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/version-files/operation/getLatestVersionFromHash
func (*VersionFilesService) GetLatestVersionsFromHashes ¶ added in v0.5.0
func (s *VersionFilesService) GetLatestVersionsFromHashes( hashes []string, algorithm string, loaders []string, gameVersions []string, ) (map[string]*Version, error)
GetLatestVersionsFromHashes gets the latest versions of projects, based on hashes from version's files.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/version-files/operation/getLatestVersionsFromHashes
type VersionsService ¶
type VersionsService service
VersionsService handles communication with the versions routes of the Modrinth API.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/versions
func (*VersionsService) Delete ¶ added in v0.1.1
func (s *VersionsService) Delete(idOrSlug string) error
Delete deletes a version.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/versions/operation/deleteVersion
func (*VersionsService) Get ¶
func (s *VersionsService) Get(idOrSlug string) (*Version, error)
Get gets a version.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/versions/operation/getVersion
func (*VersionsService) GetMultiple ¶ added in v0.3.2
func (s *VersionsService) GetMultiple(ids []string) ([]*Version, error)
GetMultiple gets multiple versions.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/versions/operation/getVersions
func (*VersionsService) ListVersions ¶
func (s *VersionsService) ListVersions(projectIDOrSlug string, options ListVersionsOptions) ([]*Version, error)
ListVersions gets all versions of a project.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/versions/operation/getProjectVersions
func (*VersionsService) Modify ¶ added in v0.3.4
func (s *VersionsService) Modify(id string, options ModifyVersionOptions) error
Modify modifies a version.
Modrinth API docs: https://docs.modrinth.com/api-spec/#tag/versions/operation/modifyVersion