metadata

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UserAgent  = `mget/` + version.Version + `; ` + version.Platform
	MaxWorkers = runtime.NumCPU() * 10
)

Functions

This section is empty.

Types

type Configure

type Configure struct {
	URL       string
	Output    string
	Proxy     string
	UserAgent string
	Head      bool
	Header    http.Header
	Cookie    []string

	Insecure bool
	Worker   int
	Block    utils.Size

	ASCII bool
	// contains filtered or unexported fields
}

func NewConfigure

func NewConfigure(url, output, proxy string,
	agent string, head bool, headers, cookies []string, insecure bool,
	worker int, blockStr string,
) (conf *Configure, e error)

func (*Configure) Client

func (c *Configure) Client() (client *http.Client, e error)

func (*Configure) Do

func (c *Configure) Do(req *http.Request) (*http.Response, error)

func (*Configure) Exists

func (c *Configure) Exists() (exists bool, e error)

func (*Configure) GetMetadata

func (c *Configure) GetMetadata(ctx context.Context) (modified string, size int64, e error)

func (*Configure) NewRequestWithContext

func (c *Configure) NewRequestWithContext(ctx context.Context, method, url string, body io.Reader) (req *http.Request, e error)

func (*Configure) Println

func (c *Configure) Println()

func (*Configure) String

func (c *Configure) String() string

func (*Configure) WriteFormat

func (c *Configure) WriteFormat(w io.Writer, prefix string) (n int, e error)

type Status

type Status int
const (
	StatusNil Status = iota
	StatusInit
	StatusDownload
	StatusError
	StatusMerge
	StatusSuccess
)

func (Status) String

func (s Status) String() string

Jump to

Keyboard shortcuts

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