v1.14.1 Latest Latest

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 10 Imported by: 0




This section is empty.


View Source
var (
	ErrInvalidRequestURL = errors.New("invalid request url, we only support https:// or http://")


func DefaultConfigRoot

func DefaultConfigRoot() (string, error)

DefaultConfigRoot will generate the default config path based on the user and his running environment.


type Client

type Client struct {

Client is the wrapper for resty.Client we may provide extra method on this wrapper.

func New

func New(c *Config) (*Client, error)

New will create a resty client with a lot of predefined settings.

func (*Client) CleanCookies added in v0.9.3

func (c *Client) CleanCookies()

func (*Client) SetDefaultHostname added in v0.8.0

func (c *Client) SetDefaultHostname(host string)

type Config

type Config struct {
	HTTPS      bool   // If the request was under the https of http.
	Host       string // The request host name.
	Proxy      string // The proxy address, such as the, socks://
	ConfigRoot string // The root config path for the whole bookhunter download service.

	// The custom redirect function.
	Redirect resty.RedirectPolicy `json:"-"`

Config is the basic configuration for creating the client.

func NewConfig

func NewConfig(rawURL, proxy, configRoot string) (*Config, error)

NewConfig will create a config instance by using the request url.

func (*Config) ConfigPath

func (c *Config) ConfigPath() (string, error)

ConfigPath will return a unique path for this download service.

Jump to

Keyboard shortcuts

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