Documentation
¶
Index ¶
- Variables
- func MkdirTemp(dir, pattern string) (string, error)
- func SetupLogger(debug, quiet bool)
- func Stderr(quiet bool) io.Writer
- func WithErr(err error) any
- type Config
- func (c Config) Executor(stdin io.Reader, stdout io.Writer) (*Executor, error)
- func (c *Config) Initialize() error
- func (c Config) Merger() *structconfig.Merger[Config]
- func (c Config) SciprtArgs() *ScriptArgs
- func (c Config) SetupLogger()
- func (c Config) StructConfig() *structconfig.StructConfig[Config]
- func (c Config) Template() (*Template, error)
- type Executor
- type ScriptArgs
- type Template
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidTemplate = errors.New("InvalidTemplate")
)
Functions ¶
func SetupLogger ¶ added in v0.4.0
func SetupLogger(debug, quiet bool)
Types ¶
type Config ¶
type Config struct {
Dry bool `json:"dry" yaml:"dry" name:"dry" usage:"do not run; display generated script"`
Debug bool `json:"debug" yaml:"debug" name:"debug" usage:"enable debug logs"`
Quiet bool `json:"quiet" yaml:"quiet" name:"quiet" short:"q" usage:"quiet stderr logs"`
Keep bool `json:"keep" yaml:"keep" name:"keep" usage:"keep generated script directory"`
WorkDir string `json:"workDir" yaml:"workDir" name:"workDir" short:"w" usage:"working directory; default: $HOME/.linep"`
Shell []string `json:"sh" yaml:"sh" name:"sh" default:"sh" usage:"execute shell command; separated by ';'"`
TemplateName string `json:"name" yaml:"name"`
TemplateScript string `json:"tscript" yaml:"tscript" name:"script" usage:"override script"`
TemplateInit string `json:"tinit" yaml:"tinit" name:"init" usage:"override init script"`
TemplateExec string `json:"texec" yaml:"texec" name:"exec" usage:"override exec script"`
TemplateMain string `json:"tmain" yaml:"tmain" name:"main" usage:"override main script name"`
Init string `json:"init" yaml:"init"`
Map string `json:"map" yaml:"map"`
Reduce string `json:"reduce" yaml:"reduce"`
Import []string `json:"import" yaml:"import" name:"import" short:"i" usage:"additional libraries; separated by '|'"`
PWD string `json:"pwd" yaml:"pwd"`
DisplayTemplate bool `json:"displayTemplate" yaml:"displayTemplate" name:"displayTemplate" usage:"do not run; display template"`
}
func (*Config) Initialize ¶ added in v0.5.3
func (Config) SciprtArgs ¶ added in v0.4.0
func (c Config) SciprtArgs() *ScriptArgs
func (Config) SetupLogger ¶
func (c Config) SetupLogger()
func (Config) StructConfig ¶ added in v0.4.0
func (c Config) StructConfig() *structconfig.StructConfig[Config]
type Executor ¶ added in v0.4.0
type ScriptArgs ¶ added in v0.4.0
type Template ¶ added in v0.4.0
type Template struct {
Name string `json:"name" yaml:"name"`
Alias []string `json:"alias" yaml:"alias"`
Script string `json:"script" yaml:"script"`
Init string `json:"init" yaml:"init"`
Exec string `json:"exec" yaml:"exec"`
Main string `json:"main" yaml:"main"`
}
func (Template) Execute ¶ added in v0.4.0
func (t Template) Execute(w io.Writer, args *ScriptArgs) error
Click to show internal directories.
Click to hide internal directories.