Documentation ¶
Overview ¶
copy of github.com/go-task/task/v3/internal/execext/devnull.go
Index ¶
- Variables
- func BroadcastInterfaces(dump bool) []net.Interface
- func BroadcastIpWithInterface(intf net.Interface) net.IP
- func DefaultOutput() io.Writer
- func DowncastMap[V any](m map[string]V) map[string]any
- func EnvSubst(input string, env map[string]any) string
- func EnvSubstSlice(inputs []string, env map[string]any) []string
- func EnvironList(overrides map[string]any) []string
- func EnvironMap(overrides map[string]any) map[string]string
- func ExecZenity(ctx context.Context, hc interp.HandlerContext, args []string) error
- func Executable() string
- func GoshExecHandler(killTimeout time.Duration) interp.ExecHandlerFunc
- func Hostname() string
- func IsDarwin() bool
- func IsTerminal() bool
- func IsWindows() bool
- func JoinedLines(lines ...string) string
- func JoinedLinesAsBytes(lines ...string) []byte
- func Map2Struct(src map[string]any, dest any)
- func Pair2Vars(pairs []string) map[string]any
- func ReadBytes(reader io.Reader) []byte
- func ReadLines(reader io.Reader) []string
- func ReadText(reader io.Reader) string
- func RenderAsTemplate(tmpl string, data map[string]any) string
- func RenderAsTemplateArray(tmplArray []string, data map[string]any) []string
- func RenderWithTemplate(w io.Writer, name string, tmpl string, data map[string]any)
- func ResolveBroadcastIp(interfaces []net.Interface, interfaceName string) (localIp net.IP, broadcastIp net.IP)
- func RunCommandWithInput(vars map[string]any, dir string, cmd string, args ...string) func(...string) CommandOutput
- func Slice2Map[V any](arr []V, keyFunc func(v V) string) map[string]V
- func Slice2Set[T comparable](arr ...T) *hashset.Set
- func SliceEquals[T comparable](a []T, b []T) bool
- func StructToMap(src any) map[string]any
- func SubstVars(m map[string]any, parentVars map[string]any, keysToSkip ...string) map[string]any
- func Text2Lines(text string) []string
- func Text2Vars(text string) map[string]any
- func TextLine2Array(line string) []string
- func ToYaml(hint string, me any) string
- func Vars2Pair(vars map[string]any) []string
- func WorkingDirectory() string
- func ZenityError(ctx context.Context, hc interp.HandlerContext, args []string) error
- func ZenityInfo(ctx context.Context, hc interp.HandlerContext, args []string) error
- func ZenityQuestion(ctx context.Context, hc interp.HandlerContext, args []string) error
- func ZenityWarning(ctx context.Context, hc interp.HandlerContext, args []string) error
- type CommandOutput
- func ParseCommandOutput(outputText string) CommandOutput
- func RunAdminCommand(vars map[string]any, adminPassword string, dir string, cmd string) CommandOutput
- func RunAppleScript(vars map[string]any, adminPassword string, dir string, script string) CommandOutput
- func RunCommandWithoutInput(vars map[string]any, dir string, cmd string, args ...string) CommandOutput
- func RunGoShellCommand(vars map[string]any, dir string, cmd string) CommandOutput
- func RunShellCommand(vars map[string]any, dir string, sh string, cmd string) CommandOutput
- func RunSudoCommand(vars map[string]any, sudoerPassword string, dir string, command string) CommandOutput
- func RunUserCommand(vars map[string]any, dir string, cmd string) CommandOutput
- type CommandOutputKind
- type CommandOutputT
- type ErrorGroup
- type ErrorGroupT
- type EventLogger
- func (me EventLogger) LogDebug(enm event.LogEnum, hub string, topic string, lsner string)
- func (me EventLogger) LogError(enm event.LogEnum, hub string, topic string, lsner string, err any)
- func (me EventLogger) LogEventDebug(enm event.LogEnum, lsner string, evnt event.Event)
- func (me EventLogger) LogEventError(enm event.LogEnum, lsner string, evnt event.Event, err any)
- func (me EventLogger) LogEventInfo(enm event.LogEnum, lsner string, evnt event.Event)
- func (me EventLogger) LogInfo(enm event.LogEnum, hub string, topic string, lsner string)
- func (me EventLogger) Target() Logger
- type EventLoggerT
- type LogContext
- type LogEntry
- type Logger
- type LoggerConfig
- type LoggerConfigT
- type LoggerT
- type OSType
Constants ¶
This section is empty.
Variables ¶
View Source
var TraceId atomic.Int64
Functions ¶
func BroadcastInterfaces ¶
func DefaultOutput ¶
func EnvironList ¶
func ExecZenity ¶ added in v1.4.0
func Executable ¶
func Executable() string
func GoshExecHandler ¶ added in v1.4.0
func GoshExecHandler(killTimeout time.Duration) interp.ExecHandlerFunc
func IsTerminal ¶
func IsTerminal() bool
func JoinedLines ¶
func JoinedLinesAsBytes ¶
func Map2Struct ¶
func RenderAsTemplateArray ¶
func RenderWithTemplate ¶
func ResolveBroadcastIp ¶
func RunCommandWithInput ¶
func Slice2Set ¶
func Slice2Set[T comparable](arr ...T) *hashset.Set
func SliceEquals ¶
func SliceEquals[T comparable](a []T, b []T) bool
func StructToMap ¶
func Text2Lines ¶
func TextLine2Array ¶
func WorkingDirectory ¶
func WorkingDirectory() string
func ZenityError ¶ added in v1.4.0
func ZenityInfo ¶ added in v1.4.0
func ZenityQuestion ¶ added in v1.4.0
func ZenityWarning ¶ added in v1.4.0
Types ¶
type CommandOutput ¶ added in v1.3.0
type CommandOutput = *CommandOutputT
func ParseCommandOutput ¶ added in v1.3.0
func ParseCommandOutput(outputText string) CommandOutput
func RunAdminCommand ¶
func RunAppleScript ¶
func RunAppleScript(vars map[string]any, adminPassword string, dir string, script string) CommandOutput
RunApplacript 运行 applacript
func RunCommandWithoutInput ¶
func RunGoShellCommand ¶
func RunGoShellCommand(vars map[string]any, dir string, cmd string) CommandOutput
func RunShellCommand ¶
func RunSudoCommand ¶
func RunUserCommand ¶
func RunUserCommand(vars map[string]any, dir string, cmd string) CommandOutput
type CommandOutputKind ¶ added in v1.3.0
type CommandOutputKind byte
const ( COMMAND_OUTPUT_KIND_TEXT CommandOutputKind = iota COMMAND_OUTPUT_KIND_VARS COMMAND_OUTPUT_KIND_JSON )
type CommandOutputT ¶ added in v1.3.0
type CommandOutputT struct { Kind CommandOutputKind Vars map[string]any Text string Json any }
type ErrorGroup ¶
type ErrorGroup = *ErrorGroupT
func NewErrorGroup ¶
func NewErrorGroup(dumpStack bool) ErrorGroup
func (ErrorGroup) Add ¶
func (me ErrorGroup) Add(err error)
func (ErrorGroup) AddGroup ¶
func (me ErrorGroup) AddGroup(that ErrorGroup)
func (ErrorGroup) AmountOfErrors ¶
func (me ErrorGroup) AmountOfErrors() int
func (ErrorGroup) Error ¶
func (me ErrorGroup) Error() string
func (ErrorGroup) HasError ¶
func (me ErrorGroup) HasError() bool
type ErrorGroupT ¶
type ErrorGroupT struct {
// contains filtered or unexported fields
}
type EventLogger ¶
type EventLogger = *EventLoggerT
func NewEventLogger ¶
func NewEventLogger(target Logger) EventLogger
func (EventLogger) LogDebug ¶
func (me EventLogger) LogDebug(enm event.LogEnum, hub string, topic string, lsner string)
func (EventLogger) LogError ¶
func (me EventLogger) LogError(enm event.LogEnum, hub string, topic string, lsner string, err any)
func (EventLogger) LogEventDebug ¶
func (me EventLogger) LogEventDebug(enm event.LogEnum, lsner string, evnt event.Event)
func (EventLogger) LogEventError ¶
func (me EventLogger) LogEventError(enm event.LogEnum, lsner string, evnt event.Event, err any)
func (EventLogger) LogEventInfo ¶
func (me EventLogger) LogEventInfo(enm event.LogEnum, lsner string, evnt event.Event)
func (EventLogger) LogInfo ¶
func (me EventLogger) LogInfo(enm event.LogEnum, hub string, topic string, lsner string)
func (EventLogger) Target ¶
func (me EventLogger) Target() Logger
type EventLoggerT ¶
type EventLoggerT struct {
// contains filtered or unexported fields
}
type LogContext ¶
type LogContext = LogEntry
func NewLogContext ¶
func NewLogContext(generateNewTraceId bool) LogContext
type Logger ¶
type Logger = *LoggerT
func NewDiscardLogger ¶
func NewDiscardLogger() Logger
func NewLogger ¶
func NewLogger(console io.Writer, config LoggerConfig, fileName string) Logger
/ verbose: log to console if true
func (Logger) NewSubLogger ¶
func (me Logger) NewSubLogger(lctx LogContext) Logger
type LoggerConfig ¶
type LoggerConfig = *LoggerConfigT
type LoggerConfigT ¶
type LoggerConfigT struct { MaxSize int `json:"max_size" yaml:"maxsize"` MaxAge int `json:"max_age" yaml:"maxage"` MaxBackups int `json:"max_backups" yaml:"maxbackups"` LocalTime bool `json:"local_time" yaml:"localtime"` Compress bool `json:"compress" yaml:"compress"` }
see lumberjack.Logger
Source Files ¶
Click to show internal directories.
Click to hide internal directories.