Documentation ¶
Index ¶
- func AddIfEmpty(arr *[]string, str *string, errStr string) bool
- func AddIfFalse(arr *[]string, val *bool, errStr string)
- func AddIfInvalid(arr *[]string, str *string, errStr string)
- func NewErr(msg string) error
- func SubmitPackage(data []byte) (bool, error)
- func ValidateIcon(params IconValidatorParams) (bool, error)
- func ValidateManifest(author string, data []byte) (bool, []string, error)
- func ValidateReadme(data []byte) (bool, error)
- type AuthOptions
- type AuthResponse
- type Base64String
- type Category
- type CommunitiesResponse
- type Community
- type CommunityCategories
- type CommunityList
- type IconValidatorParams
- type ManifestMetadata
- type Package
- type PackageListing
- type PackageSubmissionMetadata
- type PackageVersion
- type PackageWiki
- type ReviewStatus
- type Wiki
- type WikiList
- type WikiPage
- type WikiPageIndex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddIfFalse ¶ added in v0.4.1
func AddIfInvalid ¶ added in v0.4.1
func SubmitPackage ¶ added in v0.4.0
TODO: Implement this
func ValidateIcon ¶
func ValidateIcon(params IconValidatorParams) (bool, error)
Decodes image data and validates that the image is a PNG and the dimensions are 256x256.
Additionally, if the file name is specified, it will validate that it is named correctly.
Types ¶
type AuthOptions ¶ added in v0.3.0
type AuthResponse ¶ added in v0.3.0
type AuthResponse struct { Username string `json:"username"` Email *string `json:"email"` SessionID string `json:"session_id"` }
func LoginWithGithub ¶ added in v0.4.0
func LoginWithGithub(auth AuthOptions) (AuthResponse, error)
TODO: Implement this.
type Base64String ¶
type Base64String string
func (Base64String) String ¶
func (b Base64String) String() string
type Category ¶
type Category = common.PackageCategory
type CommunitiesResponse ¶ added in v0.4.0
type CommunitiesResponse struct {
Results CommunityList `json:"results"`
}
type Community ¶
type Community struct { Identifier string `json:"identifier"` Name string `json:"name"` DiscordURL *string `json:"discord_url"` WikiURL *string `json:"wiki_url"` PackageApprovalRequired bool `json:"require_package_listing_approval"` }
region Community Struct
func GetCommunity ¶
Get a specific Community by it's identifier or short name.
If the name/id does not match any existing community, the result will be nil.
func (Community) Categories ¶
type CommunityCategories ¶
type CommunityList ¶
type CommunityList []Community
func GetCommunities ¶
func GetCommunities() (CommunityList, error)
func (CommunityList) Size ¶ added in v0.5.0
func (list CommunityList) Size() int
type IconValidatorParams ¶
type ManifestMetadata ¶ added in v0.4.0
type Package ¶
type Package struct { Namespace string `json:"namespace"` Name string `json:"name"` FullName string `json:"full_name"` Owner string `json:"owner"` PackageURL string `json:"package_url"` DateCreated util.DateTime `json:"date_created"` DateUpdated util.DateTime `json:"date_updated"` Rating string `json:"rating_score"` Pinned bool `json:"is_pinned"` Deprecated bool `json:"is_deprecated"` TotalDownloads string `json:"total_downloads"` Latest PackageVersion `json:"latest"` }
type PackageListing ¶
type PackageListing struct { HasNsfwContent bool `json:"has_nsfw_content"` Categories string `json:"categories"` Community string `json:"community"` ReviewStatus ReviewStatus `json:"review_status"` }
type PackageSubmissionMetadata ¶ added in v0.4.0
type PackageVersion ¶
type PackageVersion struct { Namespace string `json:"namespace"` Name string `json:"name"` FullName string `json:"full_name"` DateCreated util.DateTime `json:"date_created"` VersionNumber string `json:"version_number"` Description string `json:"description"` Icon string `json:"icon"` Dependencies []string `json:"dependencies"` Downloads int32 `json:"total_downloads"` DownloadURL string `json:"download_url"` WebsiteURL string `json:"website_url"` Active bool `json:"is_active"` }
region PackageVersion Struct
func (PackageVersion) Changelog ¶
func (pkg PackageVersion) Changelog() (string, error)
func (PackageVersion) Readme ¶
func (pkg PackageVersion) Readme() (string, error)
type PackageWiki ¶
type ReviewStatus ¶
type ReviewStatus string
region ReviewStatus Enum
const ( UNREVIEWED ReviewStatus = "unreviewed" APPROVED ReviewStatus = "approved" REJECTED ReviewStatus = "rejected" )
func (ReviewStatus) Approved ¶
func (rs ReviewStatus) Approved() bool
func (ReviewStatus) Rejected ¶
func (rs ReviewStatus) Rejected() bool
func (ReviewStatus) Unreviewed ¶
func (rs ReviewStatus) Unreviewed() bool
type Wiki ¶
type Wiki struct { Id string `json:"id"` Title string `json:"title"` Slug string `json:"slug"` DateCreated util.DateTime `json:"datetime_created"` DateUpdated util.DateTime `json:"datetime_updated"` Pages []WikiPageIndex `json:"pages"` }
Represents the wiki section/tab of a Thunderstore package.
type WikiList ¶
type WikiList struct { Results []PackageWiki `json:"results"` Cursor string `json:"cursor"` HasMore bool `json:"has_more"` }
type WikiPage ¶
type WikiPage struct { WikiPageIndex MarkdownContent string `json:"markdown_content"` }
type WikiPageIndex ¶
type WikiPageIndex struct { ID string `json:"id"` Title string `json:"title"` Slug string `json:"slug"` DateCreated util.DateTime `json:"datetime_created"` DateUpdated util.DateTime `json:"datetime_updated"` }
func (WikiPageIndex) GetContent ¶ added in v0.3.0
func (index WikiPageIndex) GetContent() (*string, error)
Requests the content of this page.
The received string will usually be formatted as Markdown.
Click to show internal directories.
Click to hide internal directories.