Documentation
¶
Index ¶
- func NotEmpty[T ~string | ~[]string | ~[][]string](x, y T) (T, bool)
- func SetupLogger(debug, quiet bool)
- func Stderr(quiet bool) io.Writer
- type Cmd
- type Config
- type ConfigBuilder
- func (s *ConfigBuilder) Build() *Config
- func (s *ConfigBuilder) Dir(v string) *ConfigBuilder
- func (s *ConfigBuilder) PWD(v string) *ConfigBuilder
- func (s *ConfigBuilder) StderrWriter(v io.Writer) *ConfigBuilder
- func (s *ConfigBuilder) StdinReader(v io.Reader) *ConfigBuilder
- func (s *ConfigBuilder) StdoutWriter(v io.Writer) *ConfigBuilder
- type ConfigItem
- type EmptyLangSpec
- type EmptyTemplate
- type GoLangSpec
- type Lang
- type LangSpec
- type Option
- type OtherTemplate
- type PythonLangSpec
- type PythonPipenvLangSpec
- type RustLangSpec
- type Template
- type TemplateArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupLogger ¶
func SetupLogger(debug, quiet bool)
Types ¶
type Config ¶
type Config struct {
StdinReader *ConfigItem[io.Reader]
StdoutWriter *ConfigItem[io.Writer]
StderrWriter *ConfigItem[io.Writer]
Dir *ConfigItem[string]
PWD *ConfigItem[string]
}
type ConfigBuilder ¶
type ConfigBuilder struct {
// contains filtered or unexported fields
}
func NewConfigBuilder ¶
func NewConfigBuilder() *ConfigBuilder
func (*ConfigBuilder) Build ¶
func (s *ConfigBuilder) Build() *Config
func (*ConfigBuilder) Dir ¶
func (s *ConfigBuilder) Dir(v string) *ConfigBuilder
func (*ConfigBuilder) PWD ¶ added in v0.2.0
func (s *ConfigBuilder) PWD(v string) *ConfigBuilder
func (*ConfigBuilder) StderrWriter ¶
func (s *ConfigBuilder) StderrWriter(v io.Writer) *ConfigBuilder
func (*ConfigBuilder) StdinReader ¶
func (s *ConfigBuilder) StdinReader(v io.Reader) *ConfigBuilder
func (*ConfigBuilder) StdoutWriter ¶
func (s *ConfigBuilder) StdoutWriter(v io.Writer) *ConfigBuilder
type ConfigItem ¶
type ConfigItem[T any] struct { // contains filtered or unexported fields }
func NewConfigItem ¶
func NewConfigItem[T any](defaultValue T) *ConfigItem[T]
func (*ConfigItem[T]) Default ¶
func (s *ConfigItem[T]) Default() T
func (*ConfigItem[T]) Get ¶
func (s *ConfigItem[T]) Get() T
func (*ConfigItem[T]) IsModified ¶
func (s *ConfigItem[T]) IsModified() bool
func (*ConfigItem[T]) Set ¶
func (s *ConfigItem[T]) Set(value T)
type EmptyLangSpec ¶
type EmptyLangSpec struct{}
func (EmptyLangSpec) ExecCmd ¶
func (EmptyLangSpec) ExecCmd() []string
func (EmptyLangSpec) InitCmd ¶
func (EmptyLangSpec) InitCmd(_ string) [][]string
func (EmptyLangSpec) Main ¶
func (EmptyLangSpec) Main() string
func (EmptyLangSpec) Template ¶
func (EmptyLangSpec) Template() Template
type EmptyTemplate ¶
type EmptyTemplate struct{}
func NewEmptyTemplate ¶
func NewEmptyTemplate() *EmptyTemplate
func (EmptyTemplate) Execute ¶
func (EmptyTemplate) Execute(_ io.Writer, _ *TemplateArgs) error
type GoLangSpec ¶
type GoLangSpec struct{}
func (GoLangSpec) ExecCmd ¶
func (GoLangSpec) ExecCmd() []string
func (GoLangSpec) InitCmd ¶
func (GoLangSpec) InitCmd(dir string) [][]string
func (GoLangSpec) Main ¶
func (GoLangSpec) Main() string
func (GoLangSpec) Template ¶
func (GoLangSpec) Template() Template
type Option ¶
type Option func(*Config)
func WithStderrWriter ¶
func WithStdinReader ¶
func WithStdoutWriter ¶
type OtherTemplate ¶
type OtherTemplate struct {
// contains filtered or unexported fields
}
func ParseTemplateStringOrFile ¶
func ParseTemplateStringOrFile(s string) (*OtherTemplate, error)
func (OtherTemplate) Execute ¶
func (t OtherTemplate) Execute(w io.Writer, data *TemplateArgs) error
type PythonLangSpec ¶
type PythonLangSpec struct{}
func (PythonLangSpec) ExecCmd ¶
func (PythonLangSpec) ExecCmd() []string
func (PythonLangSpec) InitCmd ¶
func (PythonLangSpec) InitCmd(_ string) [][]string
func (PythonLangSpec) Main ¶
func (PythonLangSpec) Main() string
func (PythonLangSpec) Template ¶
func (PythonLangSpec) Template() Template
type PythonPipenvLangSpec ¶
type PythonPipenvLangSpec struct {
PythonLangSpec
}
func (PythonPipenvLangSpec) ExecCmd ¶
func (PythonPipenvLangSpec) ExecCmd() []string
func (PythonPipenvLangSpec) InitCmd ¶
func (PythonPipenvLangSpec) InitCmd(_ string) [][]string
type RustLangSpec ¶
type RustLangSpec struct{}
func (RustLangSpec) ExecCmd ¶
func (RustLangSpec) ExecCmd() []string
func (RustLangSpec) InitCmd ¶
func (s RustLangSpec) InitCmd(_ string) [][]string
func (RustLangSpec) Main ¶
func (RustLangSpec) Main() string
func (RustLangSpec) Template ¶
func (RustLangSpec) Template() Template
type Template ¶
type Template interface {
Execute(w io.Writer, data *TemplateArgs) error
}
func NewGoTemplate ¶
func NewGoTemplate() Template
func NewPythonTemplate ¶
func NewPythonTemplate() Template
func NewRustTemplate ¶
func NewRustTemplate() Template
Click to show internal directories.
Click to hide internal directories.