config

package
v0.0.0-...-bf18690 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var APP = struct {
	Hbooker *Hbooker
	SFacg   *SFacg
}{}
View Source
var Apps = AppConfig{}
View Source
var FileLock = &sync.Mutex{}
View Source
var HelpMessage = []string{"input help to see the command list:",
	"input quit to quit",
	"input download <bookid/url> to download book",
	"input search <keyword> to search book",
	"input show to show config",
	"input update config to update config by config.json",
	"input login <account> <password> to login account",
	"input app <app app keyword> to change app type",
	"input max <thread> to change max thread number",
	"you can input command like this: download <bookid/url>\n\n",
}
View Source
var Vars = &Apps.Config

Functions

func Error

func Error(Message string, err error, Line int) error

func Exist

func Exist(fileName any) bool

func FindID

func FindID(url string) string

func LoadJson

func LoadJson()

func ReadConfig

func ReadConfig(fileName string) []byte

func SaveJson

func SaveJson()

func UpdateConfig

func UpdateConfig()

UpdateConfig update config.json if necessary

Types

type AppConfig

type AppConfig struct {
	Hbooker HbookerCommonParams `json:"common_params"`
	Sfacg   BoluobaoConfig      `json:"sfacg_config"`
	Config  ScriptConfig        `json:"script_config"`
}

type BoluobaoConfig

type BoluobaoConfig struct {
	Cookie string `json:"cookie"`
}

type Hbooker

type Hbooker struct {
	Client   *hbookerLib.Client
	BookInfo *hbookermodel.BookInfo
}

type HbookerCommonParams

type HbookerCommonParams struct {
	LoginToken string `json:"login_token"`
	Account    string `json:"account"`
}

type SFacg

type SFacg struct {
	Client   *boluobaoLib.Client
	BookInfo *boluobaomodel.BookInfoData
}

type ScriptConfig

type ScriptConfig struct {
	ConfigName string `json:"config_name"`
	OutputName string `json:"output_name"`
	CoverFile  string `json:"cover_file"`
	DeviceId   string `json:"device_id"`
	ThreadNum  int    `json:"thread_num"`
	MaxRetry   int    `json:"max_retry"`
	Epub       bool   `json:"epub"`
}

Jump to

Keyboard shortcuts

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