commands

package
v0.0.0-...-01a91d6 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	// Output gets the output lines that should be embedded
	Output() ([]string, error)
	// Parse parses a comment as this command
	//
	// If the comment cannot be parsed, an error is returned.
	Parse(comment string) error
}

Command is a generic embedme command

type EmbedCommandOutputCommand

type EmbedCommandOutputCommand struct {
	Command
	Cmd        string
	WorkingDir string
	FS         afero.Fs
}

EmbedCommandOutputCommand ...

func NewEmbedCommandOutputCommand

func NewEmbedCommandOutputCommand(fs afero.Fs, cwd string) *EmbedCommandOutputCommand

NewEmbedCommandOutputCommand ...

func (*EmbedCommandOutputCommand) Output

func (cmd *EmbedCommandOutputCommand) Output() ([]string, error)

Output ...

func (*EmbedCommandOutputCommand) Parse

func (cmd *EmbedCommandOutputCommand) Parse(comment string) error

Parse ...

type EmbedFileCommand

type EmbedFileCommand struct {
	Command
	Root      string
	Path      string
	StartLine int
	EndLine   int
	BaseDirs  []string
	FS        afero.Fs
}

EmbedFileCommand ...

func NewEmbedFileCommand

func NewEmbedFileCommand(fs afero.Fs, baseDirs ...string) *EmbedFileCommand

NewEmbedFileCommand ...

func (*EmbedFileCommand) Lines

func (cmd *EmbedFileCommand) Lines() (int, int, bool)

Lines ...

func (*EmbedFileCommand) Output

func (cmd *EmbedFileCommand) Output() ([]string, error)

Output ...

func (*EmbedFileCommand) Parse

func (cmd *EmbedFileCommand) Parse(comment string) error

Parse ...

type EmbedURLCommand

type EmbedURLCommand struct {
	Command
	URL url.URL
}

EmbedURLCommand ...

func NewEmbedURLCommand

func NewEmbedURLCommand(url url.URL) *EmbedURLCommand

NewEmbedURLCommand ...

func (*EmbedURLCommand) Output

func (cmd *EmbedURLCommand) Output() ([]string, error)

Output ...

func (*EmbedURLCommand) Parse

func (cmd *EmbedURLCommand) Parse(comment string) error

Parse ...

Jump to

Keyboard shortcuts

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