Documentation ¶
Index ¶
- type Community
- type CommunityList
- type Package
- type PackageDependency
- type PackageList
- func (original *PackageList) AddFlat(list PackageList)
- func (list PackageList) ExcludeCategories(categories ...string) PackageList
- func (list PackageList) Filter(predicate func(pkg Package) bool) PackageList
- func (list PackageList) Get(author string, name string) *Package
- func (list PackageList) GetByUUID(uuid string) *Package
- func (list PackageList) GetExact(fullName string) *Package
- func (list PackageList) Size() uint
- func (original *PackageList) ToMap() map[string]Package
- type PackageMetrics
- type PackageVersion
- type PackageVersionMetrics
- type SocialAuthConnection
- type SubscriptionStatus
- type UserMedia
- type UserProfile
- type UserTeam
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Community ¶
type Community struct {
Identifier string
}
func (Community) AllPackages ¶
func (comm Community) AllPackages(predicate ...func(item Package, index int) bool) (PackageList, error)
Returns a list of all packages (mods) within this community.
type CommunityList ¶ added in v0.6.0
type CommunityList []Community
func NewCommunityList ¶ added in v0.6.0
func NewCommunityList(identifiers ...string) (list CommunityList)
type Package ¶
type Package struct { Name string `json:"name"` FullName string `json:"full_name"` Owner string `json:"owner"` UUID string `json:"uuid4"` PackageURL string `json:"package_url"` DonationLink string `json:"donation_link"` DateCreated util.DateTime `json:"date_created"` DateUpdated util.DateTime `json:"date_updated"` Rating uint16 `json:"rating_score"` Pinned bool `json:"is_pinned"` Deprecated bool `json:"is_deprecated"` HasNsfwContent bool `json:"has_nsfw_content"` Categories []string `json:"categories"` Versions []PackageVersion `json:"versions"` }
Represents a package/mod on Thunderstore that is global and not specific to any community.
To easily find a version from Versions, use Package.GetVersion.
func (Package) GetVersion ¶ added in v0.2.0
func (pkg Package) GetVersion(verNumber string) *PackageVersion
Gets a specific PackageVersion from this package's list of versions.
verNumber should be specified in the format: major.minor.patch
Good:
"v3.0.0", "2.1.1", "1.0.0-beta.1"
Bad:
"v3.1", "v2", "1.0"
type PackageDependency ¶
type PackageDependency struct { CommunityID *string `json:"community_identifier"` CommunityName *string `json:"community_name"` Description string `json:"description"` ImageSource *string `json:"image_src"` Namespace string `json:"namespace"` PackageName string `json:"package_name"` VersionNumber string `json:"version_number"` }
type PackageList ¶
type PackageList []Package
An alias for a Package array with helper functions attached.
func PackagesFromCommunities ¶ added in v0.6.0
func PackagesFromCommunities(communities []Community) (PackageList, error)
Returns a single slice with all packages from the specified communities.
func (*PackageList) AddFlat ¶ added in v0.6.0
func (original *PackageList) AddFlat(list PackageList)
func (PackageList) ExcludeCategories ¶ added in v0.6.0
func (list PackageList) ExcludeCategories(categories ...string) PackageList
Returns a new list containing only packages that do NOT have any of the input categories. If no parameters are passed, the original list is returned unchanged.
func (PackageList) Filter ¶
func (list PackageList) Filter(predicate func(pkg Package) bool) PackageList
Performs a filter on the list, returning a new list containing only packages that satisfy the predicate.
func (PackageList) Get ¶
func (list PackageList) Get(author string, name string) *Package
Grab a single package from the list given the package owner's name and the package's short name.
func (PackageList) GetByUUID ¶ added in v0.2.0
func (list PackageList) GetByUUID(uuid string) *Package
Grab a single package from the list given the package owner's name and the package's short name.
func (PackageList) GetExact ¶ added in v0.2.0
func (list PackageList) GetExact(fullName string) *Package
Grab a single package from the list given the package's full name.
A full name would look like so:
"Owen3H-CSync"
func (PackageList) Size ¶
func (list PackageList) Size() uint
The amount of packages in the list.
Equivalent to len(list) casted to a uint.
func (*PackageList) ToMap ¶ added in v0.6.0
func (original *PackageList) ToMap() map[string]Package
type PackageMetrics ¶
type PackageVersion ¶
type PackageVersion struct { Name string `json:"name"` FullName string `json:"full_name"` UUID string `json:"uuid4"` Dependencies []string `json:"dependencies"` Description string `json:"description"` DownloadURL string `json:"download_url"` Downloads uint32 `json:"downloads"` DateCreated util.DateTime `json:"date_created"` FileSize uint64 `json:"file_size"` Icon string `json:"icon"` Active bool `json:"is_active"` VersionNumber string `json:"version_number"` WebsiteURL string `json:"website_url"` }
A specific version of a package.
Note: This is NOT equivalent to Package as its fields differ.
type PackageVersionMetrics ¶
type PackageVersionMetrics struct {
Downloads uint32 `json:"downloads"`
}
type SocialAuthConnection ¶
type SubscriptionStatus ¶
type SubscriptionStatus struct {
Expires string `json:"expires"`
}
type UserProfile ¶
type UserProfile struct { Username string `json:"username"` Capabilities []*string `json:"capabilities"` Connections []SocialAuthConnection `json:"connections"` Subscription SubscriptionStatus `json:"subscription"` RatedPackages []*string `json:"rated_packages"` Teams []*string `json:"teams"` TeamsFull []UserTeam `json:"teams_full"` }
Represents the profile of a Thunderstore user.