Documentation
¶
Index ¶
- type Client
- func (c *Client) GetDownloadLinks(ctx context.Context, gameDomain string, modID, fileID int) ([]DownloadLink, error)
- func (c *Client) GetLatestAdded(ctx context.Context, gameDomain string) ([]ModData, error)
- func (c *Client) GetLatestUpdated(ctx context.Context, gameDomain string) ([]ModData, error)
- func (c *Client) GetMod(ctx context.Context, gameDomain string, modID int) (*ModData, error)
- func (c *Client) GetModFiles(ctx context.Context, gameDomain string, modID int) (*ModFileList, error)
- func (c *Client) GetModRequirements(ctx context.Context, gameDomain string, modID int) ([]ModRequirement, error)
- func (c *Client) GetTrending(ctx context.Context, gameDomain string) ([]ModData, error)
- func (c *Client) IsAuthenticated() bool
- func (c *Client) SearchMods(ctx context.Context, gameDomain, query string, limit, offset int) ([]ModData, error)
- func (c *Client) SetAPIKey(key string)
- func (c *Client) ValidateAPIKey(ctx context.Context, key string) error
- type DownloadLink
- type FileData
- type FileUpdate
- type ModData
- type ModFileList
- type ModRequirement
- type NexusMods
- func (n *NexusMods) AuthURL() string
- func (n *NexusMods) CheckUpdates(ctx context.Context, installed []domain.InstalledMod) ([]domain.Update, error)
- func (n *NexusMods) ExchangeToken(ctx context.Context, code string) (*source.Token, error)
- func (n *NexusMods) GetDependencies(ctx context.Context, mod *domain.Mod) ([]domain.ModReference, error)
- func (n *NexusMods) GetDownloadURL(ctx context.Context, mod *domain.Mod, fileID string) (string, error)
- func (n *NexusMods) GetMod(ctx context.Context, gameID, modID string) (*domain.Mod, error)
- func (n *NexusMods) GetModFiles(ctx context.Context, mod *domain.Mod) ([]domain.DownloadableFile, error)
- func (n *NexusMods) ID() string
- func (n *NexusMods) IsAuthenticated() bool
- func (n *NexusMods) Name() string
- func (n *NexusMods) Search(ctx context.Context, query source.SearchQuery) ([]domain.Mod, error)
- func (n *NexusMods) SetAPIKey(key string)
- func (n *NexusMods) ValidateAPIKey(ctx context.Context, key string) error
- type UpdateEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the NexusMods REST API v1 and GraphQL v2 APIs
func (*Client) GetDownloadLinks ¶
func (c *Client) GetDownloadLinks(ctx context.Context, gameDomain string, modID, fileID int) ([]DownloadLink, error)
GetDownloadLinks fetches download URLs for a mod file
func (*Client) GetLatestAdded ¶
GetLatestAdded fetches the latest added mods for a game
func (*Client) GetLatestUpdated ¶
GetLatestUpdated fetches the latest updated mods for a game
func (*Client) GetModFiles ¶
func (c *Client) GetModFiles(ctx context.Context, gameDomain string, modID int) (*ModFileList, error)
GetModFiles fetches files for a mod
func (*Client) GetModRequirements ¶
func (c *Client) GetModRequirements(ctx context.Context, gameDomain string, modID int) ([]ModRequirement, error)
GetModRequirements fetches mod dependencies using the GraphQL API
func (*Client) GetTrending ¶
GetTrending fetches the trending mods for a game
func (*Client) IsAuthenticated ¶
IsAuthenticated returns true if an API key is configured
func (*Client) SearchMods ¶
func (c *Client) SearchMods(ctx context.Context, gameDomain, query string, limit, offset int) ([]ModData, error)
SearchMods searches for mods using the NexusMods GraphQL v2 API.
type DownloadLink ¶
type DownloadLink struct {
Name string `json:"name"`
ShortName string `json:"short_name"`
URI string `json:"URI"`
}
DownloadLink represents a download URL response
type FileData ¶
type FileData struct {
FileID int `json:"file_id"`
Name string `json:"name"`
FileName string `json:"file_name"`
Version string `json:"version"`
CategoryID int `json:"category_id"`
CategoryName string `json:"category_name"`
IsPrimary bool `json:"is_primary"`
Size int64 `json:"size"`
SizeKB int64 `json:"size_kb"`
SizeInBytes *int64 `json:"size_in_bytes"`
UploadedTime time.Time `json:"uploaded_time"`
ModVersion string `json:"mod_version"`
ExternalVirusID string `json:"external_virus_scan_url"`
Description string `json:"description"`
Changelog string `json:"changelog_html"`
}
FileData represents a mod file from the NexusMods REST API
type FileUpdate ¶
type FileUpdate struct {
OldFileID int `json:"old_file_id"`
NewFileID int `json:"new_file_id"`
OldFileName string `json:"old_file_name"`
NewFileName string `json:"new_file_name"`
UploadedTime string `json:"uploaded_time"`
}
FileUpdate represents file version relationships
type ModData ¶
type ModData struct {
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"`
Author string `json:"author"`
UploadedBy string `json:"uploaded_by"`
UploadedByProfileURL string `json:"uploaded_users_profile_url"`
CategoryID int `json:"category_id"`
PictureURL string `json:"picture_url"`
ContainsAdultContent bool `json:"contains_adult_content"`
Status string `json:"status"`
Available bool `json:"available"`
EndorsementCount int `json:"endorsement_count"`
CreatedTime time.Time `json:"created_time"`
UpdatedTime time.Time `json:"updated_time"`
AllowRating bool `json:"allow_rating"`
}
ModData represents a mod from the NexusMods REST API
type ModFileList ¶
type ModFileList struct {
Files []FileData `json:"files"`
FileUpdates []FileUpdate `json:"file_updates"`
}
ModFileList represents the response from the mod files endpoint
type ModRequirement ¶
ModRequirement represents a dependency returned from the GraphQL API
type NexusMods ¶
type NexusMods struct {
// contains filtered or unexported fields
}
NexusMods implements the ModSource interface
func (*NexusMods) CheckUpdates ¶
func (n *NexusMods) CheckUpdates(ctx context.Context, installed []domain.InstalledMod) ([]domain.Update, error)
CheckUpdates checks for available updates by comparing installed versions against NexusMods
func (*NexusMods) ExchangeToken ¶
ExchangeToken exchanges an OAuth code for tokens. NexusMods uses API key authentication instead of OAuth. Use SetAPIKey() or the NEXUSMODS_API_KEY environment variable.
func (*NexusMods) GetDependencies ¶
func (n *NexusMods) GetDependencies(ctx context.Context, mod *domain.Mod) ([]domain.ModReference, error)
GetDependencies returns mod dependencies from NexusMods
func (*NexusMods) GetDownloadURL ¶
func (n *NexusMods) GetDownloadURL(ctx context.Context, mod *domain.Mod, fileID string) (string, error)
GetDownloadURL gets the download URL for a mod file
func (*NexusMods) GetModFiles ¶
func (n *NexusMods) GetModFiles(ctx context.Context, mod *domain.Mod) ([]domain.DownloadableFile, error)
GetModFiles returns the available download files for a mod
func (*NexusMods) IsAuthenticated ¶
IsAuthenticated returns true if an API key is configured
type UpdateEntry ¶
type UpdateEntry struct {
ModID int `json:"mod_id"`
LatestFileUpdate int64 `json:"latest_file_update"`
LatestModActivity int64 `json:"latest_mod_activity"`
}
UpdateEntry represents a mod update from the updated mods endpoint