fetcher

package
v0.0.0-...-3a391b9 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TrimSpace

func TrimSpace(s string) (string, error)

Types

type AddCommandArgs

type AddCommandArgs struct {
	Key     string
	Command string
	Trim    bool
}

type Fetcher

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

func FetcherFactory

func FetcherFactory(commands []*clients.Cmd, addCommands []AddCommandArgs) (*Fetcher, error)

func NewFetcher

func NewFetcher() *Fetcher

func (*Fetcher) AddCommand

func (inst *Fetcher) AddCommand(cmdInst *clients.Cmd)

AddCommand takes a command instance and adds it the fetcher

func (*Fetcher) AddNewCommand

func (inst *Fetcher) AddNewCommand(key, cmd string, trim bool) error

AddNewCommand creates a new command from a string then adds it to the fetcher

func (*Fetcher) Fetch

func (inst *Fetcher) Fetch(ctx clients.ExecContext, pack any) error

Fetch executes the commands on the container passed as the ctx and use the results to populate pack

func (*Fetcher) SetPostProcessor

func (inst *Fetcher) SetPostProcessor(ppFunc PostProcessFuncType)

type PostProcessFuncType

type PostProcessFuncType func(map[string]string) (map[string]any, error)

Jump to

Keyboard shortcuts

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