Documentation
¶
Overview ¶
Package exec provides options for the compose exec command
Index ¶
- func WithCommand(command ...string) compose.SetComposeExecOption
- func WithDetach() compose.SetComposeExecOption
- func WithEnv(keyValue ...string) compose.SetComposeExecOption
- func WithIndex(index int) compose.SetComposeExecOption
- func WithNoTTY() compose.SetComposeExecOption
- func WithPrivileged() compose.SetComposeExecOption
- func WithProfiles(profiles ...string) compose.SetComposeExecOption
- func WithService(service string) compose.SetComposeExecOption
- func WithStdin(r io.Reader) compose.SetComposeExecOption
- func WithUser(user string) compose.SetComposeExecOption
- func WithWorkdir(dir string) compose.SetComposeExecOption
- func WithWriter(writer io.Writer) compose.SetComposeExecOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithCommand ¶
func WithCommand(command ...string) compose.SetComposeExecOption
WithCommand sets the command and arguments (required), e.g. WithCommand("sh", "-c", "echo hi")
func WithDetach ¶
func WithDetach() compose.SetComposeExecOption
WithDetach runs the command in the background
func WithEnv ¶
func WithEnv(keyValue ...string) compose.SetComposeExecOption
WithEnv sets environment variables (key=value), can be used multiple times
func WithIndex ¶
func WithIndex(index int) compose.SetComposeExecOption
WithIndex sets the index of the container when the service has multiple replicas
func WithNoTTY ¶
func WithNoTTY() compose.SetComposeExecOption
WithNoTTY disables pseudo-TTY allocation (use for scripts or piping)
func WithPrivileged ¶
func WithPrivileged() compose.SetComposeExecOption
WithPrivileged gives extended privileges to the process
func WithProfiles ¶
func WithProfiles(profiles ...string) compose.SetComposeExecOption
WithProfiles sets the profiles to activate
func WithService ¶
func WithService(service string) compose.SetComposeExecOption
WithService sets the service name (required)
func WithStdin ¶
func WithStdin(r io.Reader) compose.SetComposeExecOption
WithStdin sets the reader to forward to the container (e.g. os.Stdin for interactive)
func WithUser ¶
func WithUser(user string) compose.SetComposeExecOption
WithUser runs the command as this user (e.g. "root", "1000:1000")
func WithWorkdir ¶
func WithWorkdir(dir string) compose.SetComposeExecOption
WithWorkdir sets the working directory for the command
func WithWriter ¶
func WithWriter(writer io.Writer) compose.SetComposeExecOption
WithWriter sets the writer for stdout/stderr
Types ¶
This section is empty.