script_config

package
v0.0.0-...-549b2e0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

TODO rename this to something clearer

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeScriptConfigInto

func DecodeScriptConfigInto(data *ScriptConfig, doc *document.Document, container *cst.Node, consumed map[string]bool, keyPrefix string) error

func DecodeWithOutputFormatInto

func DecodeWithOutputFormatInto(data *WithOutputFormat, doc *document.Document, container *cst.Node, consumed map[string]bool, keyPrefix string) error

func EncodeScriptConfigFrom

func EncodeScriptConfigFrom(data *ScriptConfig, doc *document.Document, container *cst.Node) error

func EncodeWithOutputFormatFrom

func EncodeWithOutputFormatFrom(data *WithOutputFormat, doc *document.Document, container *cst.Node) error

func MakeWriterTo

func MakeWriterTo(
	rs RemoteScript,
	env map[string]string,
	args ...string,
) (wt *writerTo, err error)

func MakeWriterToWithStdin

func MakeWriterToWithStdin(
	script RemoteScript,
	env map[string]string,
	reader io.Reader,
	args ...string,
) (writerTo *writerTo, err error)

Types

type RemoteScript

type RemoteScript interface {
	Cmd(args ...string) (*exec.Cmd, error)
}

type RemoteScriptWithEnv

type RemoteScriptWithEnv interface {
	RemoteScript
	Environ() map[string]string
}

type ScriptConfig

type ScriptConfig struct {
	Description string            `toml:"description"`
	Shell       []string          `toml:"shell,omitempty"`
	Script      string            `toml:"script,omitempty,multiline"`
	Env         map[string]string `toml:"env,omitempty"`
}

func (ScriptConfig) Cmd

func (s ScriptConfig) Cmd(args ...string) (c *exec.Cmd, err error)

func (*ScriptConfig) Environ

func (a *ScriptConfig) Environ() map[string]string

func (ScriptConfig) Equals

func (a ScriptConfig) Equals(b ScriptConfig) bool

func (*ScriptConfig) Merge

func (s *ScriptConfig) Merge(s2 ScriptConfig)

func (*ScriptConfig) Reset

func (a *ScriptConfig) Reset()

type ScriptConfigDocument

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

func DecodeScriptConfig

func DecodeScriptConfig(input []byte) (*ScriptConfigDocument, error)

func (*ScriptConfigDocument) Comment

func (d *ScriptConfigDocument) Comment(key string) string

func (*ScriptConfigDocument) Data

func (*ScriptConfigDocument) Encode

func (d *ScriptConfigDocument) Encode() ([]byte, error)

func (*ScriptConfigDocument) InlineComment

func (d *ScriptConfigDocument) InlineComment(key string) string

func (*ScriptConfigDocument) SetComment

func (d *ScriptConfigDocument) SetComment(key, comment string)

func (*ScriptConfigDocument) SetInlineComment

func (d *ScriptConfigDocument) SetInlineComment(key, comment string)

func (*ScriptConfigDocument) Undecoded

func (d *ScriptConfigDocument) Undecoded() []string

type WithOutputFormat

type WithOutputFormat struct {
	ScriptConfig
	UTI           string   `toml:"uti"` // deprecated
	UTIS          []string `toml:"utis"`
	FileExtension string   `toml:"file-extension"`
}

func (WithOutputFormat) Equals

func (*WithOutputFormat) Merge

func (s *WithOutputFormat) Merge(s2 WithOutputFormat)

type WithOutputFormatDocument

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

func DecodeWithOutputFormat

func DecodeWithOutputFormat(input []byte) (*WithOutputFormatDocument, error)

func (*WithOutputFormatDocument) Comment

func (d *WithOutputFormatDocument) Comment(key string) string

func (*WithOutputFormatDocument) Data

func (*WithOutputFormatDocument) Encode

func (d *WithOutputFormatDocument) Encode() ([]byte, error)

func (*WithOutputFormatDocument) InlineComment

func (d *WithOutputFormatDocument) InlineComment(key string) string

func (*WithOutputFormatDocument) SetComment

func (d *WithOutputFormatDocument) SetComment(key, comment string)

func (*WithOutputFormatDocument) SetInlineComment

func (d *WithOutputFormatDocument) SetInlineComment(key, comment string)

func (*WithOutputFormatDocument) Undecoded

func (d *WithOutputFormatDocument) Undecoded() []string

Source Files

  • main.go
  • main_tommy.go
  • with_output_format.go
  • with_output_format_tommy.go
  • writer_to.go

Jump to

Keyboard shortcuts

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