Documentation
¶
Index ¶
- Variables
- func BootstrapConfig(configPath, downloadPath string)
- func BootstrapLogger(verbosityLevel int)
- func CompletionActionRun(cmd *cobra.Command, args []string)
- func Execute() error
- func HelpOnly(cmd *cobra.Command, args []string)
- func PackageCmdPersistentPreRun(cmd *cobra.Command, args []string)
- func UpdateCmdRun(cmd *cobra.Command, args []string)
- func UpdateKeyListCmdRun(cmd *cobra.Command, args []string)
- func UpdateOrderListCmdRun(cmd *cobra.Command, args []string)
- type CanPrint
- type HbOrder
- type HbPathIds
- type HbPayee
- type HbProduct
- type HbSubProduct
- type HbSubProductDownload
- type HbSubProductDownloadDownloadStruct
- type HbSubProductDownloadDownloadStructAsmConfig
- type HbSubProductDownloadDownloadStructAsmManifest
- type HbSubProductDownloadDownloadStructUrl
- type HbSubProductDownloadOptionsDict
- type HttpClient
- type MungeComponents
- type ResponseGuardNeeded
- type ResponseLoginSuccessful
- type StringFromChoices
- type UniqueStringList
Constants ¶
This section is empty.
Variables ¶
var ( TotalAmountSpent = float64(0) CurrencyList = NewUniqueStringList() SubProductHumanNameList = NewUniqueStringList() ProductCategoryList = NewUniqueStringList() ProductHumanNameList = NewUniqueStringList() PayeeHumanNameList = NewUniqueStringList() PlatformList = NewUniqueStringList() ArchList = NewUniqueStringList() TotalFileSize = int64(0) DownloadStructNameList = NewUniqueStringList() )
var CompletionAction = &cobra.Command{ Use: "completion", Short: "Generate autocompletion files", Run: CompletionActionRun, }
var CompletionFormat = StringFromChoices{ // contains filtered or unexported fields }
var CompletionOutputFilePath string
var ConfigDirectoryFlagValue string
var DownloadDirectoryFlagValue string
var ForceRefreshConfigFlag bool
var ( Logger = &logrus.Logger{ Out: os.Stderr, Formatter: formatter, } )
var MetaCmd = &cobra.Command{ Use: "meta", Short: "Meta features like autocompletion", Run: HelpOnly, }
var PackageCmd = &cobra.Command{ Use: "wotw-hb", Version: PackageVersion, Short: "WIP Humble Bundle CLI", PersistentPreRun: PackageCmdPersistentPreRun, Run: HelpOnly, }
var PackageVersion = "0.0.0"
var UpdateCmd = &cobra.Command{ Use: "update", Short: "Update local databases", Run: UpdateCmdRun, }
var UpdateKeyListCmd = &cobra.Command{ Use: "keys", Short: "Update the full list of purchases (bundles, store purchases, etc.)", Run: UpdateKeyListCmdRun, }
var UpdateOrderListCmd = &cobra.Command{ Use: "orders", Short: "Update information about all the available orders (bundle contents, file type variants, links, etc.)", Run: UpdateOrderListCmdRun, }
var VerbosityFlagValue int
Functions ¶
func BootstrapConfig ¶
func BootstrapConfig(configPath, downloadPath string)
func BootstrapLogger ¶
func BootstrapLogger(verbosityLevel int)
func CompletionActionRun ¶
func UpdateCmdRun ¶
func UpdateKeyListCmdRun ¶
func UpdateOrderListCmdRun ¶
Types ¶
type HbOrder ¶
type HbOrder struct {
AmountSpent float64 `json:"amount_spent"`
Claimed bool `json:"claimed"`
Created string `json:"created"`
Currency string `json:"currency"`
Gamekey string `json:"gamekey"`
IsGiftee bool `json:"is_giftee"`
MissedCredit interface{} `json:"missed_credit"`
PathIds HbPathIds `json:"path_ids"`
Product HbProduct `json:"product"`
SubProducts []HbSubProduct `json:"subproducts"`
Total float64 `json:"total"`
Uid string `json:"uid"`
}
jq '[.[] | keys] | flatten | unique' all-orders.json
type HbPayee ¶
type HbPayee struct {
HumanName string `json:"human_name"`
MachineName string `json:"machine_name"`
}
jq '[.[].subproducts[].payee | keys] | flatten | unique' all-orders.json
type HbProduct ¶
type HbProduct struct {
Category string `json:"category"`
// Haven't found a pattern to this yet
EmptyTpkds interface{} `json:"empty_tpkds"`
HumanName string `json:"human_name"`
MachineName string `json:"machine_name"`
PartialGiftEnabled bool `json:"partial_gift_enabled"`
PostPurchaseText string `json:"post_purchase_text"`
SubscriptionCredits int `json:"subscription_credits"`
}
jq '[.[].product | keys] | flatten | unique' all-orders.json
type HbSubProduct ¶
type HbSubProduct struct {
CustomDownloadPageBox string `json:"custom_download_page_box_html"`
Downloads []HbSubProductDownload `json:"downloads"`
HumanName string `json:"human_name"`
Icon string `json:"icon"`
LibraryFamilyName string `json:"library_family_name"`
MachineName string `json:"machine_name"`
Payee HbPayee `json:"payee"`
Url string `json:"url"`
}
jq '[.[].subproducts[] | keys] | flatten | unique' all-orders.json
type HbSubProductDownload ¶
type HbSubProductDownload struct {
AndroidAppOnly bool `json:"android_app_only"`
DownloadIdentifer string `json:"download_identifier"`
DownloadStruct []HbSubProductDownloadDownloadStruct `json:"download_struct"`
DownloadVersionNumber int `json:"download_version_number"`
MachineName string `json:"machine_name"`
// At least one product returns options_dict = [] which breaks Go
// Search for "jacklumber_linux"
OptionsDict interface{} `json:"options_dict"`
Platform string `json:"platform"`
}
jq '[.[].subproducts[].downloads[] | keys] | flatten | unique' all-orders.json
type HbSubProductDownloadDownloadStruct ¶
type HbSubProductDownloadDownloadStruct struct {
Arch string `json:"arch"`
AsmConfig HbSubProductDownloadDownloadStructAsmConfig `json:"asm_config"`
AsmManifest HbSubProductDownloadDownloadStructAsmManifest `json:"asm_manifest"`
ExternalLink string `json:"external_link"`
FileSize int64 `json:"file_size"`
ForceDownload bool `json:"force_download"`
HdStreamUrl string `json:"hd_stream_url"`
HumanSize string `json:"human_size"`
KindleFriendly bool `json:"kindle_friendly"`
Md5 string `json:"md5"`
Name string `json:"name"`
SdStreamUrl string `json:"sd_stream_url"`
Sha1 string `json:"sha1"`
Small int `json:"small"`
Timestamp int64 `json:"timestamp"`
Timetstamp int64 `json:"timetstamp"`
UploadedAt string `json:"uploaded_at"`
Url HbSubProductDownloadDownloadStructUrl `json:"url"`
UsesKindleSender bool `json:"uses_kindle_sender"`
}
jq '[.[].subproducts[].downloads[].download_struct[] | keys] | flatten | unique' all-orders.json
type HbSubProductDownloadDownloadStructAsmConfig ¶
type HbSubProductDownloadDownloadStructAsmConfig struct {
CloudMountPoint string `json:"cloudMountPoint"`
DisplayItem string `json:"display_item"`
WarnCrash bool `json:"warnCrash"`
}
jq '[.[] | select(0 < (.subproducts | length)).subproducts[] | select(0 < (.downloads | length)).downloads[] | select(0 < (.download_struct | length)).download_struct[] | select(.asm_config != null).asm_config | keys] | flatten | unique' all-orders.json
type HbSubProductDownloadDownloadStructAsmManifest ¶
type HbSubProductDownloadDownloadStructAsmManifest interface{}
q '[.[] | select(0 < (.subproducts | length)).subproducts[] | select(0 < (.downloads | length)).downloads[] | select(0 < (.download_struct | length)).download_struct[] | select(.asm_manifest != null).asm_manifest | keys] | flatten | unique' all-orders.json
type HbSubProductDownloadDownloadStructUrl ¶
type HbSubProductDownloadDownloadStructUrl struct {
BitTorrent string `json:"bittorrent"`
Web string `json:"web"`
}
jq '[.[] | select(0 < (.subproducts | length)).subproducts[] | select(0 < (.downloads | length)).downloads[] | select(0 < (.download_struct | length)).download_struct[] | select(.url != null).url | keys] | flatten | unique' all-orders.json
type HbSubProductDownloadOptionsDict ¶
type HbSubProductDownloadOptionsDict struct {
Is64BitToggle int `json:"is64bittoggle"`
}
jq '[.[] | select(0 < (.subproducts | length)).subproducts[] | select(0 < (.downloads | length)).downloads[] | select(.options_dict != null).options_dict | keys] | flatten | unique' all-orders.json
type MungeComponents ¶
type ResponseGuardNeeded ¶
type ResponseLoginSuccessful ¶
type ResponseLoginSuccessful struct {
UserTerms interface{} `json:"user_terms_opt_in_data"`
Goto string `json:"goto"`
}
type StringFromChoices ¶
type StringFromChoices struct {
// contains filtered or unexported fields
}
func (*StringFromChoices) Set ¶
func (s *StringFromChoices) Set(value string) error
func (*StringFromChoices) String ¶
func (s *StringFromChoices) String() string
func (*StringFromChoices) Type ¶
func (s *StringFromChoices) Type() string
type UniqueStringList ¶
type UniqueStringList struct {
// contains filtered or unexported fields
}
func NewUniqueStringList ¶
func NewUniqueStringList(elements ...string) *UniqueStringList
func (*UniqueStringList) Add ¶
func (u *UniqueStringList) Add(elements ...string) *UniqueStringList
func (*UniqueStringList) Contents ¶
func (u *UniqueStringList) Contents() []string
func (*UniqueStringList) Size ¶
func (u *UniqueStringList) Size() int