api

package
v0.23.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiError

type ApiError struct {
	Type    ErrorType
	Message string
	Err     error
}

ApiError represents an error from the Humble Bundle API

func NewBundleNotFoundError

func NewBundleNotFoundError() *ApiError

NewBundleNotFoundError creates a new bundle not found error

func NewDeserializeError

func NewDeserializeError(err error) *ApiError

NewDeserializeError creates a new deserialization error

func NewNetworkError

func NewNetworkError(err error) *ApiError

NewNetworkError creates a new network error

func (*ApiError) Error

func (e *ApiError) Error() string

func (*ApiError) Unwrap

func (e *ApiError) Unwrap() error

type ErrorType

type ErrorType int

ErrorType represents the type of API error

const (
	NetworkError ErrorType = iota
	DeserializeError
	BundleNotFound
)

type HumbleApi

type HumbleApi struct {
	// contains filtered or unexported fields
}

HumbleApi provides methods to interact with the Humble Bundle API

func New

func New(authKey string) *HumbleApi

New creates a new HumbleApi instance

func (*HumbleApi) ListBundleKeys

func (api *HumbleApi) ListBundleKeys() ([]string, error)

ListBundleKeys fetches all bundle keys for the authenticated user

func (*HumbleApi) ListBundles

func (api *HumbleApi) ListBundles() ([]models.Bundle, error)

ListBundles fetches all bundles for the authenticated user

func (*HumbleApi) ReadBundle

func (api *HumbleApi) ReadBundle(productKey string) (*models.Bundle, error)

ReadBundle fetches details for a specific bundle

func (*HumbleApi) ReadBundleChoices

func (api *HumbleApi) ReadBundleChoices(when string) (*models.HumbleChoice, error)

ReadBundleChoices fetches Humble Choice data for a given period when should be in "month-year" format (e.g., "january-2023") or "home" for current

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL