runnercmd

package
v0.0.0-...-a1bc676 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

README

Package cloudeng.io/glean/gleancli/runner/runnercmd

import cloudeng.io/glean/gleancli/runner/runnercmd

Functions

Func NewCmdSet
func NewCmdSet(spec string, cmds []CommandSpec, globalFlagValues any) *subcmd.CommandSetYAML
Func TemplateFuncs
func TemplateFuncs(authFiles map[string]string) template.FuncMap

TemplateFuncs returns a template.FuncMap that contains an AuthFile function that provides access to the supplied authFiles map.

Types

Type CommandSpec
type CommandSpec struct {
	Name       string
	FlagValues any
	Runner     subcmd.Runner
}

CommandSpec represents a simple top-level command that can be added to a subcmd.CommandSetYAML.

Type CrawlFlags
type CrawlFlags struct {
	ProcessDownloads bool `subcmd:"process-downloads,true,'process downloaded files'"`
}
Type T
type T struct {
	Datasources          []string
	CrawlCommands        map[string][]string
	ProcessCommands      map[string][]string
	IndexCommands        map[string][]string
	TestCacheCommands    map[string][]string
	AuthFiles            map[string]string
	GlobalExecOpts       []cmdexec.Option
	DatasourceConfigFile string
}
Methods
func (c *T) Crawl(ctx context.Context, values interface{}, args []string) error
func (c *T) CrawlAll(ctx context.Context, values interface{}, _ []string) error
func (c *T) CrawlIndex(ctx context.Context, _ interface{}, args []string) error
func (c *T) Index(ctx context.Context, _ interface{}, args []string) error
func (c *T) IndexAll(ctx context.Context, _ interface{}, _ []string) error
func (c *T) NewRunner(datasource string) *cmdexec.Runner
func (c *T) NewRunnerOpts(datasource string) []cmdexec.Option
func (c *T) RunCommands(ctx context.Context, datasource string, cmdsets ...map[string][]string) error
func (c *T) ShowAll(_ context.Context, _ interface{}, _ []string) error
func (c *T) Spec() (string, []CommandSpec)
func (c *T) TestCache(ctx context.Context, _ interface{}, args []string) error
func (c *T) TestCacheAll(ctx context.Context, _ interface{}, _ []string) error
Type TemplateVars
type TemplateVars struct {
	DatasourceName       string
	DatasourceConfigFile string
}

TemplateVars represents the variables that can be accessed from templates.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdSet

func NewCmdSet(spec string, cmds []CommandSpec, globalFlagValues any) *subcmd.CommandSetYAML

func TemplateFuncs

func TemplateFuncs(authFiles map[string]string) template.FuncMap

TemplateFuncs returns a template.FuncMap that contains an AuthFile function that provides access to the supplied authFiles map.

Types

type CommandSpec

type CommandSpec struct {
	Name       string
	FlagValues any
	Runner     subcmd.Runner
}

CommandSpec represents a simple top-level command that can be added to a subcmd.CommandSetYAML.

type CrawlFlags

type CrawlFlags struct {
	ProcessDownloads bool `subcmd:"process-downloads,true,'process downloaded files'"`
}

type CrawlIndexFlags

type CrawlIndexFlags struct {
	CrawlFlags
	IndexFlags
}

type IndexFlags

type IndexFlags struct {
	IndexingDryRun bool `subcmd:"indexing-dry-run,false,'dry run only'"`
}

type T

type T struct {
	Datasources          []string
	CrawlCommands        map[string][]string
	ProcessCommands      map[string][]string
	IndexCommands        map[string][]string
	IndexStatsCommands   map[string][]string
	TestCacheCommands    map[string][]string
	AuthFiles            map[string]string
	GlobalExecOpts       []cmdexec.Option
	DatasourceConfigFile string
}

func (*T) Crawl

func (c *T) Crawl(ctx context.Context, values interface{}, args []string) error

func (*T) CrawlAll

func (c *T) CrawlAll(ctx context.Context, values interface{}, _ []string) error

func (*T) CrawlIndex

func (c *T) CrawlIndex(ctx context.Context, values interface{}, args []string) error

func (*T) CrawlIndexAll

func (c *T) CrawlIndexAll(ctx context.Context, values interface{}, _ []string) error

func (*T) Index

func (c *T) Index(ctx context.Context, values interface{}, args []string) error

func (*T) IndexAll

func (c *T) IndexAll(ctx context.Context, values interface{}, _ []string) error

func (*T) IndexingStats

func (c *T) IndexingStats(ctx context.Context, values interface{}, args []string) error

func (*T) NewRunner

func (c *T) NewRunner(datasource string, flags any) *cmdexec.Runner

func (*T) NewRunnerOpts

func (c *T) NewRunnerOpts(datasource string, flags any) []cmdexec.Option

func (*T) RunCommands

func (c *T) RunCommands(ctx context.Context, datasource string, flags any, cmdsets ...map[string][]string) error

RunCommands runs the supplied commands for the specified datasource. Flags represents the flags made available as template variables.

func (*T) ShowAll

func (c *T) ShowAll(_ context.Context, _ interface{}, _ []string) error

func (*T) Spec

func (c *T) Spec() (string, []CommandSpec)

func (*T) TestCache

func (c *T) TestCache(ctx context.Context, values interface{}, args []string) error

func (*T) TestCacheAll

func (c *T) TestCacheAll(ctx context.Context, values interface{}, _ []string) error

type TemplateVars

type TemplateVars struct {
	DatasourceName       string
	DatasourceConfigFile string
	Flags                any
}

TemplateVars represents the variables that can be accessed from templates.

Jump to

Keyboard shortcuts

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