instance

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultLogger added in v0.1.6

func DefaultLogger(w io.Writer) zerolog.Logger

Types

type FlagsState

type FlagsState struct {
	// the path of the config file
	ConfigPath string
	// the verbosity level (0 = quiet, 1 = default, 2 = verbose, 3 = debug)
	Verbosity int
	// force overwrite of downloaded assets
	Force bool
	// stop at the first error
	Strict bool
	// skip writing to the disk
	DryRun bool
	// do not emit output
	Quiet bool
	// display the progress bar
	Progress bool
}

type Grab

type Grab struct {
	// the parsed configuration
	Config *config.Config
	// the flags of the "get" command
	Flags *FlagsState
	// the caller command ("get")
	Command *cobra.Command

	// the original urls passed as arguments
	URLs []string
	// the number of assets to be downloaded
	TotalAssets int64
	// a map of all the regular expressions to be used
	RegexCache config.RegexCacheMap
}

func New

func New(cmd *cobra.Command) *Grab

func (*Grab) BuildAssetCache

func (s *Grab) BuildAssetCache() *hcl.Diagnostics

func (*Grab) BuildSiteCache

func (s *Grab) BuildSiteCache()

func (*Grab) Download

func (s *Grab) Download() error

func (*Grab) ParseConfig

func (s *Grab) ParseConfig() *hcl.Diagnostics

func (*Grab) ParseFlags

func (s *Grab) ParseFlags()

func (*Grab) ParseURLs

func (s *Grab) ParseURLs(args []string) *hcl.Diagnostics

Jump to

Keyboard shortcuts

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