cmd

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultDatabase        = DatabaseSpec{Type: "sqlite", Path: "scrape_data/scrape.db"}
	ErrDatabaseFormat      = errors.New("database spec must be in the format <type>:<path spec>")
	ErrUnsupportedDatabase = errors.New("unsupported database type")
)

Functions

func NewDatabaseValue

func NewDatabaseValue(env string, def DatabaseSpec) *envflags.Value[DatabaseSpec]

Types

type DatabaseFlags added in v0.8.0

type DatabaseFlags struct {
	Migrate bool
	// contains filtered or unexported fields
}

func AddDatabaseFlags added in v0.8.0

func AddDatabaseFlags(baseEnv string, flags *flag.FlagSet, migrateFlag bool) *DatabaseFlags

func (DatabaseFlags) Database added in v0.8.0

func (f DatabaseFlags) Database() (store.Factory, error)

func (DatabaseFlags) MustDatabase added in v0.8.0

func (f DatabaseFlags) MustDatabase() store.Factory

func (DatabaseFlags) String added in v0.8.0

func (f DatabaseFlags) String() DatabaseSpec

type DatabaseSpec

type DatabaseSpec struct {
	Type string
	Path string
}

func NewDatabaseSpec

func NewDatabaseSpec(s string) (DatabaseSpec, error)

Format: <type>:<path spec> Example: sqlite:scrape_data/scrape.db Example: sqlite::memory:

func (DatabaseSpec) String

func (d DatabaseSpec) String() string

type ProxyFlags added in v0.8.0

type ProxyFlags struct {
	// contains filtered or unexported fields
}

func AddProxyFlags added in v0.8.0

func AddProxyFlags(proxyName string, withEnabledFlag bool, flags *flag.FlagSet) *ProxyFlags

Set up the command line args and environment variables for a proxy. The assumption here is that the app ultimately supports at least two different proxies, one for general usage and another for headless scraping. The general proxy should pass an empty proxy name. Other proxies should pass a unique name, which will be used in constructing the environment variable and command line argument names.

func (*ProxyFlags) Enabled added in v0.8.0

func (p *ProxyFlags) Enabled() bool

func (*ProxyFlags) Password added in v0.8.0

func (p *ProxyFlags) Password() string

func (*ProxyFlags) ProxyURL added in v0.8.0

func (p *ProxyFlags) ProxyURL() string

func (*ProxyFlags) Username added in v0.8.0

func (p *ProxyFlags) Username() string

Jump to

Keyboard shortcuts

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