Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CobraLambda ¶
type CobraLambda struct {
// contains filtered or unexported fields
}
func NewCobraLambdaCLI ¶ added in v0.1.0
func NewCobraLambdaCLI(ctx context.Context, cmd *cobra.Command) *CobraLambda
func (*CobraLambda) Execute ¶
func (w *CobraLambda) Execute(args []string) (*CobraLambdaOutput, error)
Execute runs the Cobra command with the given arguments and captures all output This method is thread-safe and will restore os.Stdout/Stderr even if the command panics Note: Only one execution can run at a time per wrapper instance to avoid interference
func (*CobraLambda) ExecuteContext ¶
func (w *CobraLambda) ExecuteContext(ctx context.Context, args []string) (*CobraLambdaOutput, error)
ExecuteWithContext is a convenience method that runs Execute with the provided context overriding context passed in from NewCobraLambda and restoring to original context after execution
type CobraLambdaEvent ¶ added in v0.1.0
type CobraLambdaEvent struct {
Args []string `json:"args"`
}
func UnmarshalEvent ¶ added in v0.1.0
func UnmarshalEvent(eventJSON json.RawMessage) (*CobraLambdaEvent, error)
type CobraLambdaFunc ¶ added in v0.1.0
func NewCobrLambdaHandler ¶ added in v0.1.0
func NewCobrLambdaHandler(cmd *cobra.Command) CobraLambdaFunc
type CobraLambdaOutput ¶ added in v0.2.0
CobraLambdaOutput holds captured output from both Cobra command and os.Stdout/Stderr
Click to show internal directories.
Click to hide internal directories.