config

package
v0.0.0-...-c9220a3 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Apps     = AppConfig{}
	Vars     = &Apps.Config
	FileLock = &sync.Mutex{}
)
View Source
var APP = struct {
	Hbooker *Hbooker
	SFacg   *SFacg
}{}
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",
}

Functions

func DirectoryExists

func DirectoryExists(dirName string) bool

func EnsureDirectoriesExist

func EnsureDirectoriesExist(dirNames []string)

func LoadConfig

func LoadConfig()

func ReadConfig

func ReadConfig(fileName string) ([]byte, error)

func SaveConfig

func SaveConfig()

func UpdateConfig

func UpdateConfig()

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