Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultUrlGetFilesFormat = "https://api.nexusmods.com/v1/games/%v/mods/%v/files.json"
View Source
const DefaultUrlGetModFormat = "https://api.nexusmods.com/v1/games/%v/mods/%v.json"
Variables ¶
View Source
var ErrorNoApiKey = errors.New("no nexus api key provided")
View Source
var ErrorNoDriver = errors.New("no nexus http driver provided")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(options ...ClientOption) (*Client, error)
type ClientOption ¶
type ClientOption func(*ClientOptions)
func WithApiKey ¶
func WithApiKey(key string) ClientOption
func WithHTTPDriver ¶
func WithHTTPDriver(driver HttpClient) ClientOption
func WithUrlGetFilesFormat ¶ added in v0.2.1
func WithUrlGetFilesFormat(format string) ClientOption
func WithUrlGetModFormat ¶
func WithUrlGetModFormat(format string) ClientOption
Format should contains 2 placeholder in this sequence:
- Game code
- Mod ID
Defaults to: [DefaultUrlGetModFormat]
type ClientOptions ¶
type ClientOptions struct {
Driver HttpClient
ApiKey string
UrlGetModFormat string
UrlGetFilesFormat string
}
type HttpClient ¶
type SchemaMod ¶
type SchemaMod struct {
Uid int `json:"uid"`
ModId int `json:"mod_id"`
GameId int `json:"game_id"`
DomainName string `json:"domain_name"`
Name string `json:"name"`
Summary string `json:"summary"`
Description string `json:"description"`
Version string `json:"version"`
CategoryId int `json:"category_id"`
Status string `json:"status"`
MetadataPageUrl string
MetadataCategoryIcon string
Author string `json:"author"`
UploadedBy string `json:"uploaded_by"`
UploadedUsersProfileUrl string `json:"uploaded_users_profile_url"`
PictureUrl string `json:"picture_url"`
AllowRating bool `json:"allow_rating"`
ContainsAdultContent bool `json:"contains_adult_content"`
Available bool `json:"available"`
EndorsementCount int `json:"endorsement_count"`
ModDownloads int `json:"mod_downloads"`
ModUniqueDownloads int `json:"mod_unique_downloads"`
CreatedTimestamp int `json:"created_timestamp"`
UpdatedTimestamp int `json:"updated_timestamp"`
User *SchemaModUser `json:"user"`
Endorsement *SchemaModEndorsement `json:"endorsement"`
Files *SchemaModFiles
}
type SchemaModEndorsement ¶
type SchemaModFile ¶ added in v0.2.1
type SchemaModFile struct {
Id []int `json:"id"`
Uid int `json:"uid"`
FileId int `json:"file_id"`
CategoryId int `json:"category_id"`
Name string `json:"name"`
CategoryName string `json:"category_name"`
FileName string `json:"file_name"`
Description string `json:"description"`
Version string `json:"version"`
ModVersion string `json:"mod_version"`
IsPrimary bool `json:"is_primary"`
Size int `json:"size"`
SizeKb int `json:"size_kb"`
SizeKbInBytes int `json:"size_kb_in_bytes"`
UploadedTimestamp int `json:"uploaded_timestamp"`
UploadedTime string `json:"uploaded_time"`
ExternalVirusScanUrl string `json:"external_virus_scan_url"`
ChangelogHtml string `json:"changelog_html"`
ContentPreviewLink string `json:"content_preview_link"`
}
type SchemaModFileUpdate ¶ added in v0.2.1
type SchemaModFiles ¶ added in v0.2.1
type SchemaModFiles struct {
Files []SchemaModFile `json:"files"`
FileUpdates []SchemaModFileUpdate `json:"file_updates"`
}
type SchemaModUser ¶
Click to show internal directories.
Click to hide internal directories.