Documentation
¶
Index ¶
- Constants
- type ApiQueryOption
- type ApiQueryParams
- type CfgFunc
- type Config
- type CurseClient
- type DefaultSlogClientLogger
- type GetModsByIdsListRequest
- type Logger
- type MinecraftModLoadersQueryOption
- type MinecraftVersionsQueryOption
- type ModsQueryOption
- func WithGameID(g string) ModsQueryOption
- func WithModsCategoryID(cid string) ModsQueryOption
- func WithModsCategoryIDs(cids string) ModsQueryOption
- func WithModsClassID(cid string) ModsQueryOption
- func WithModsGameID(id string) ModsQueryOption
- func WithModsGameVersion(gv string) ModsQueryOption
- func WithModsIndex(index int64) ModsQueryOption
- func WithModsModLoaderType(mlt int) ModsQueryOption
- func WithModsPageSize(pageSize int64) ModsQueryOption
- func WithModsSeatchFilter(q string) ModsQueryOption
- func WithModsSortField(field int) ModsQueryOption
- func WithModsSortOrder(order string) ModsQueryOption
Constants ¶
View Source
const (
CurseforgeBaseURL = "https://api.curseforge.com"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiQueryOption ¶
type ApiQueryOption func(ApiQueryParams)
func PageIndex ¶
func PageIndex(index int64) ApiQueryOption
func PageSize ¶
func PageSize(size int64) ApiQueryOption
type ApiQueryParams ¶
func (ApiQueryParams) QueryString ¶
func (f ApiQueryParams) QueryString() string
type CfgFunc ¶
type CfgFunc func(config *Config)
func EnableDebug ¶
func WithEndpoint ¶
func WithLogger ¶
func WithTimeout ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func NewDefaultConfig ¶
func (*Config) NewHTTPClient ¶
type CurseClient ¶
type CurseClient interface {
GetGameVersions(ctx context.Context, gameID string) (versions *types.GameVersionsResponse, err error)
GetCategories(ctx context.Context, gameID string) (*types.GetCategoriesResponse, error)
GetMods(ctx context.Context, opts ...ModsQueryOption) (*types.ModsResponse, error)
GetModsByIDs(ctx context.Context, req *GetModsByIdsListRequest, opts ...ModsQueryOption) (*types.ModsResponse, error)
GetModDescription(ctx context.Context, modID int64) (*types.StringResponse, error)
GetModFiles(ctx context.Context, modID int64) (*types.GetModFilesResponse, error)
}
func NewCurseClient ¶
func NewCurseClient(apiKey string, opts ...CfgFunc) CurseClient
type DefaultSlogClientLogger ¶
type DefaultSlogClientLogger struct {
Logger
// contains filtered or unexported fields
}
func (DefaultSlogClientLogger) DebugRequest ¶
func (l DefaultSlogClientLogger) DebugRequest(res *http.Response)
func (DefaultSlogClientLogger) Printf ¶
func (l DefaultSlogClientLogger) Printf(format string, args ...any)
func (DefaultSlogClientLogger) Println ¶
func (l DefaultSlogClientLogger) Println(v ...any)
type GetModsByIdsListRequest ¶
type Logger ¶
type Logger interface {
Printf(format string, v ...any)
Println(v ...any)
DebugRequest(res *http.Response)
}
type MinecraftModLoadersQueryOption ¶
type MinecraftModLoadersQueryOption ApiQueryOption
func WithIncludeAll ¶
func WithIncludeAll(b bool) MinecraftModLoadersQueryOption
func WithMinecraftVersion ¶
func WithMinecraftVersion(version string) MinecraftModLoadersQueryOption
type MinecraftVersionsQueryOption ¶
type MinecraftVersionsQueryOption ApiQueryOption
func WithSortDescending ¶
func WithSortDescending(descending bool) MinecraftVersionsQueryOption
type ModsQueryOption ¶
type ModsQueryOption ApiQueryOption
func WithGameID ¶
func WithGameID(g string) ModsQueryOption
func WithModsCategoryID ¶
func WithModsCategoryID(cid string) ModsQueryOption
func WithModsCategoryIDs ¶
func WithModsCategoryIDs(cids string) ModsQueryOption
func WithModsClassID ¶
func WithModsClassID(cid string) ModsQueryOption
func WithModsGameID ¶
func WithModsGameID(id string) ModsQueryOption
func WithModsGameVersion ¶
func WithModsGameVersion(gv string) ModsQueryOption
func WithModsIndex ¶
func WithModsIndex(index int64) ModsQueryOption
func WithModsModLoaderType ¶
func WithModsModLoaderType(mlt int) ModsQueryOption
func WithModsPageSize ¶
func WithModsPageSize(pageSize int64) ModsQueryOption
func WithModsSeatchFilter ¶
func WithModsSeatchFilter(q string) ModsQueryOption
func WithModsSortField ¶
func WithModsSortField(field int) ModsQueryOption
func WithModsSortOrder ¶
func WithModsSortOrder(order string) ModsQueryOption
Click to show internal directories.
Click to hide internal directories.