package
1.35.0
Repository: https://github.com/snowflake-labs/sansshell.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Functions

CommandGroup is an option which sets the gid for the Command to run as.
CommandUser is an option which sets the uid for the Command to run as.
EnvVar is an option which sets an environment variable for the sub-processes.
FailOnStderr is an option where the command will return an error if any output appears on stderr regardless of exit code.
IsStreamToTerminal checks if the stream is connected to a terminal Could not be covered with test, requires manual testing on changes.
NewLimitedBuffer will create a LimitedBuffer with the given maximum size.
OptionsEqual returns true if the results of applying both Options are equal.
OptionsEqual returns true if the results of applying all elements of both Option slices are equal.
RunCommand will take the given binary and args and execute it returning all relevent state (stdout, stderr, errors, etc).
StderrMax is an option where the command run will limit output buffered from stdout to this many bytes before truncating.
StdoutMax is an option where the command run will limit output buffered from stdout to this many bytes before truncating.
TrimString will return the given string truncated to MAX_BUF size so it can be used in grpc error replies.
ValidPath ensures the path passed in is both absolute and clean.

# Constants

DefRunBufLimit is the default limit we'll buffer for stdout/stderr from RunCommand exec'ing a process.
MaxBuf is the maximum we should allow stdout or stderr to be when sending back in an error string.

# Variables

StreamingChunkSize is the chunk size we use when sending replies on a stream.

# Structs

CommandRun groups all of the status and output from executing a command.
ExecuteState is used by client packages in services to pass relevant state down to subcommands.
KeyValue is used below with KeyValueSliceFlag to construct foo=bar,baz=foo type of flags.
LimitedBuffer is a bytes.Buffer with the added limitation that it will not grow infinitely and will instead stop at a max size limit.
StringSliceCommaOrWhitespaceFlag is the parsed form of a flag accepting either "foo,bar,baz" or "foo bar baz" style.
StringSliceFlag is the parsed form of a flag using "foo,bar,baz" style.

# Interfaces

Option will run the apply operation to change required checking/state before executing RunCommand.

# Type aliases

IntSliceFlags is a custom flag for a list of ints in a comma separated list.
KeyValueSliceFlag is a custom flag for a list of strings in a comma separated list of the form key=value,key=value.