cli

package
v0.0.0-...-a9532b6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2020 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LoggingCacheCommand               = "logging-cache"
	LoggingCacheCreateCommand         = "create"
	LoggingCacheGetCommand            = "get"
	LoggingCacheRemoveCommand         = "remove"
	LoggingCacheCloseAndRemoveCommand = "close-and-remove"
	LoggingCacheClearCommand          = "clear"
	LoggingCachePruneCommand          = "prune"
	LoggingCacheLenCommand            = "len"
)

Constants representing the jasper.LoggingCache interface as CLI commands.

View Source
const (
	ManagerCommand         = "manager"
	IDCommand              = "id"
	CreateProcessCommand   = "create-process"
	CreateScriptingCommand = "create-scripting"
	CreateCommand          = "create-command"
	GetCommand             = "get"
	GroupCommand           = "group"
	ListCommand            = "list"
	ClearCommand           = "clear"
	CloseCommand           = "close"
)

Constants representing the Jasper Manager interface as CLI commands.

View Source
const (
	ProcessCommand                 = "process"
	InfoCommand                    = "info"
	CompleteCommand                = "complete"
	RegisterSignalTriggerIDCommand = "register-signal-trigger-id"
	RespawnCommand                 = "respawn"
	RunningCommand                 = "running"
	SignalCommand                  = "signal"
	TagCommand                     = "tag"
	GetTagsCommand                 = "get-tags"
	ResetTagsCommand               = "reset-tags"
	WaitCommand                    = "wait"
)

Constants representing the Jasper Process interface as CLI commands.

View Source
const (
	RemoteCommand       = "remote"
	DownloadFileCommand = "download-file"
	GetLogStreamCommand = "get-log-stream"
	SignalEventCommand  = "signal-event"
	WriteFileCommand    = "write-file"
	SendMessagesCommand = "send-messages"
)

Constants representing the Jasper RemoteClient interface as CLI commands.

View Source
const (
	ServiceCommand        = "service"
	InstallCommand        = "install"
	UninstallCommand      = "uninstall"
	StartCommand          = "start"
	StopCommand           = "stop"
	RestartCommand        = "restart"
	RunCommand            = "run"
	StatusCommand         = "status"
	ForceReinstallCommand = "force-reinstall"
)

Constants representing the Jasper service interface as a CLI command.

View Source
const (
	RPCService      = "rpc"
	RESTService     = "rest"
	CombinedService = "combined"
	WireService     = "wire"
)

Constants representing the supported Jasper service types.

View Source
const (
	// ClientCommand represents the Jasper client interface as a CLI command.
	ClientCommand = "client"
)
View Source
const (
	// JasperCommand represents the Jasper interface as a CLI command.
	JasperCommand = "jasper"
)

Variables

This section is empty.

Functions

func BuildClientCommand

func BuildClientCommand(basePrefix ...string) []string

BuildClientCommand is a convenience function to generate the slice of strings to invoke the Client subcommand.

func BuildJasperCommand

func BuildJasperCommand(basePrefix ...string) []string

BuildJasperCommand is a convenience function to generate the slice of strings to invoke the Jasper subcommand.

func BuildManagerClearCommand

func BuildManagerClearCommand(basePrefix ...string) []string

BuildManagerClearCommand is a convenience function to generate the slice of strings to invoke the Jasper.Client.Manager.Clear subcommand.

func BuildManagerCloseCommand

func BuildManagerCloseCommand(basePrefix ...string) []string

BuildManagerCloseCommand is a convenience function to generate the slice of strings to invoke the Jasper.Client.Manager.Close subcommand.

func BuildManagerCommand

func BuildManagerCommand(basePrefix ...string) []string

BuildManagerCommand is a convenience function to generate the slice of strings to invoke the Jasper.Client.Manager subcommand.

func BuildManagerCreateCommand

func BuildManagerCreateCommand(basePrefix ...string) []string

BuildManagerCreateCommand is a convenience function to generate the slice of strings to invoke the Jasper.Client.Manager.CreateCommand subcommand.

func BuildManagerCreateProcessCommand

func BuildManagerCreateProcessCommand(basePrefix ...string) []string

BuildManagerCreateProcessCommand is a convenience function to generate the slice of strings to invoke the Jasper.Client.Manager.CreateProcess subcommand.

func BuildManagerGetCommand

func BuildManagerGetCommand(basePrefix ...string) []string

BuildManagerGetCommand is a convenience function to generate the slice of strings to invoke the Jasper.Client.Manager.Get subcommand.

func BuildManagerGroupCommand

func BuildManagerGroupCommand(basePrefix ...string) []string

BuildManagerGroupCommand is a convenience function to generate the slice of strings to invoke the Jasper.Client.Manager.Group subcommand.

func BuildManagerIDCommand

func BuildManagerIDCommand(basePrefix ...string) []string

BuildManagerIDCommand is a convenience function to generate the slice of strings to invoke the Jasper.Client.Manager.ID subcommand.

func BuildManagerListCommand

func BuildManagerListCommand(basePrefix ...string) []string

BuildManagerListCommand is a convenience function to generate the slice of strings to invoke the Jasper.Client.Manager.List subcommand.

func BuildProcessCommand

func BuildProcessCommand(basePrefix ...string) []string

BuildProcessCommand is a convenience function to generate the slice of strings to invoke the Jasper.Client.Process subcommand.

func BuildProcessCompleteCommand

func BuildProcessCompleteCommand(basePrefix ...string) []string

BuildProcessCompleteCommand is a convenience function to generate the slice of strings to invoke the Jasper.Client.Process.Complete subcommand.

func BuildProcessGetTagsCommand

func BuildProcessGetTagsCommand(basePrefix ...string) []string

BuildProcessGetTagsCommand is a convenience function to generate the slice of strings to invoke the Jasper.Client.Process.GetTags subcommand.

func BuildProcessInfoCommand

func BuildProcessInfoCommand(basePrefix ...string) []string

BuildProcessInfoCommand is a convenience function to generate the slice of strings to invoke the Jasper.Client.Process.Info subcommand.

func BuildProcessRegisterSignalTriggerIDCommand

func BuildProcessRegisterSignalTriggerIDCommand(basePrefix ...string) []string

BuildProcessRegisterSignalTriggerIDCommand is a convenience function to generate the slice of strings to invoke the Jasper.Client.Process.RegisterSignalTriggerID subcommand.

func BuildProcessResetTagsCommand

func BuildProcessResetTagsCommand(basePrefix ...string) []string

BuildProcessResetTagsCommand is a convenience function to generate the slice of strings to invoke the Jasper.Client.Process.ResetTags subcommand.

func BuildProcessRespawnCommand

func BuildProcessRespawnCommand(basePrefix ...string) []string

BuildProcessRespawnCommand is a convenience function to generate the slice of strings to invoke the Jasper.Client.Process.Respawn subcommand.

func BuildProcessRunningCommand

func BuildProcessRunningCommand(basePrefix ...string) []string

BuildProcessRunningCommand is a convenience function to generate the slice of strings to invoke the Jasper.Client.Process.Running subcommand.

func BuildProcessSignalCommand

func BuildProcessSignalCommand(basePrefix ...string) []string

BuildProcessSignalCommand is a convenience function to generate the slice of strings to invoke the Jasper.Client.Process.Signal subcommand.

func BuildProcessTagCommand

func BuildProcessTagCommand(basePrefix ...string) []string

BuildProcessTagCommand is a convenience function to generate the slice of strings to invoke the Jasper.Client.Process.Tag subcommand.

func BuildProcessWaitCommand

func BuildProcessWaitCommand(basePrefix ...string) []string

BuildProcessWaitCommand is a convenience function to generate the slice of strings to invoke the Jasper.Client.Process.Wait subcommand.

func BuildRemoteCommand

func BuildRemoteCommand(basePrefix ...string) []string

BuildRemoteCommand is a convenience function to generate the slice of strings to invoke the Jasper.Client.Remote subcommand.

func BuildRemoteDownloadFileCommand

func BuildRemoteDownloadFileCommand(basePrefix ...string) []string

BuildRemoteDownloadFileCommand is a convenience function to generate the slice of strings to invoke the Jasper.Client.Remote.DownloadFile subcommand.

func BuildRemoteGetLogStreamCommand

func BuildRemoteGetLogStreamCommand(basePrefix ...string) []string

BuildRemoteGetLogStreamCommand is a convenience function to generate the slice of strings to invoke the Jasper.Client.Remote.GetLogStream subcommand.

func BuildRemoteSignalEventCommand

func BuildRemoteSignalEventCommand(basePrefix ...string) []string

BuildRemoteSignalEventCommand is a convenience function to generate the slice of strings to invoke the Jasper.Client.Remote.SignalEvent subcommand.

func BuildRemoteWriteFileCommand

func BuildRemoteWriteFileCommand(basePrefix ...string) []string

BuildRemoteWriteFileCommand is a convenience function to generate the slice of strings to invoke the Jasper.Client.Remote.WriteFile subcommand.

func BuildServiceCommand

func BuildServiceCommand(basePrefix ...string) []string

BuildServiceCommand is a convenience function to generate the slice of strings to invoke the Jasper.Service subcommand.

func BuildServiceForceReinstallCommand

func BuildServiceForceReinstallCommand(basePrefix ...string) []string

BuildServiceForceReinstallCommand is a convenience function to generate the slice of strings to invoke the Jasper.Service.ForceReinstall subcommand.

func BuildServiceInstallCommand

func BuildServiceInstallCommand(basePrefix ...string) []string

BuildServiceInstallCommand is a convenience function to generate the slice of strings to invoke the Jasper.Service.Install subcommand.

func BuildServiceRestartCommand

func BuildServiceRestartCommand(basePrefix ...string) []string

BuildServiceRestartCommand is a convenience function to generate the slice of strings to invoke the Jasper.Service.Restart subcommand.

func BuildServiceRunCommand

func BuildServiceRunCommand(basePrefix ...string) []string

BuildServiceRunCommand is a convenience function to generate the slice of strings to invoke the Jasper.Service.Run subcommand.

func BuildServiceStartCommand

func BuildServiceStartCommand(basePrefix ...string) []string

BuildServiceStartCommand is a convenience function to generate the slice of strings to invoke the Jasper.Service.Start subcommand.

func BuildServiceStatusCommand

func BuildServiceStatusCommand(basePrefix ...string) []string

BuildServiceStatusCommand is a convenience function to generate the slice of strings to invoke the Jasper.Service.Status subcommand.

func BuildServiceStopCommand

func BuildServiceStopCommand(basePrefix ...string) []string

BuildServiceStopCommand is a convenience function to generate the slice of strings to invoke the Jasper.Service.Stop subcommand.

func BuildServiceUninstallCommand

func BuildServiceUninstallCommand(basePrefix ...string) []string

BuildServiceUninstallCommand is a convenience function to generate the slice of strings to invoke the Jasper.Service.Uninstall subcommand.

func ClearCMD

func ClearCMD() cli.Command

ClearCMD removes all terminated/exited processes from Jasper Manager.

func Client

func Client() cli.Command

Client encapsulates the client-side interface to a Jasper service. Operations read from standard input (if necessary) and write the result to standard output.

func DownloadCMD

func DownloadCMD() cli.Command

DownloadCMD exposes a simple interface for using jasper to download files on the remote jasper.Manager.

func ErrBufferFull

func ErrBufferFull() error

ErrBufferFull returns an error indicating that a CappedWriter's buffer has reached max capacity.

func Jasper

func Jasper() cli.Command

Jasper is the CLI interface to Jasper services. This is used by jasper.Manager implementations that manage processes remotely via commands via command executions. The interface is designed for machine interaction.

func KillAllCMD

func KillAllCMD() cli.Command

KillAllCMD terminates all processes with a given tag, sending either TERM or KILL.

func KillCMD

func KillCMD() cli.Command

KillCMD terminates a single process by id, sending either TERM or KILL.

func ListCMD

func ListCMD() cli.Command

ListCMD provides a user interface to inspect processes managed by a jasper instance and their state. The output of the command is a human-readable table.

func LoggingCache

func LoggingCache() cli.Command

LoggingCache creates a cli.Command that supports the jasper.LoggingCache interface. (jasper.LoggingCache).Put is not supported as there is no CLI equivalent.

func Manager

func Manager() cli.Command

Manager creates a cli.Command that interfaces with a Jasper manager. Each subcommand optionally reads the arguments as JSON from stdin if any are required, calls the jasper.Manager function corresponding to that subcommand, and writes the response as JSON to stdout.

func NewSSHClient

func NewSSHClient(remoteOpts options.Remote, clientOpts ClientOptions, trackProcs bool) (remote.Manager, error)

NewSSHClient creates a new Jasper manager that connects to a remote machine's Jasper service over SSH using the remote machine's Jasper CLI.

func Process

func Process() cli.Command

Process creates a cli.Command that interfaces with a Jasper process. Due to it being a remote process, there is no CLI equivalent of of RegisterTrigger or RegisterSignalTrigger.

func Remote

func Remote() cli.Command

Remote creates a cli.Command that allows the remote-specific methods in the RemoteClient interface except for CloseClient, for which there is no CLI equivalent.

func RunCMD

func RunCMD() cli.Command

RunCMD provides a simple user-centered command-line interface for running commands on a remote instance.

func Service

func Service() cli.Command

Service encapsulates the functionality to set up Jasper services. Except for run, the subcommands will generally require elevated privileges to execute.

Types

type BuildloggerURLsResponse

type BuildloggerURLsResponse struct {
	OutcomeResponse `json:"outcome"`
	URLs            []string `json:"urls,omitempty"`
}

BuildloggerURLsResponse represents CLI-specific output containing the Buildlogger URLs for a process.

func ExtractBuildloggerURLsResponse

func ExtractBuildloggerURLsResponse(input []byte) (BuildloggerURLsResponse, error)

ExtractBuildloggerURLsResponse unmarshals the input bytes into a BuildloggerURLsResponse and checks if the request was successful.

type CachedLoggerResponse

type CachedLoggerResponse struct {
	OutcomeResponse `json:"outcome"`
	Logger          options.CachedLogger `json:"logger"`
}

CachedLoggerResponse represents CLI-specific output describing the logger that has been cached in the remote service.

func ExtractCachedLoggerResponse

func ExtractCachedLoggerResponse(input json.RawMessage) (CachedLoggerResponse, error)

ExtractCachedLoggerResponse unmarshals the input bytes into a CachedLoggerResponse and checks if the request was successful.

type CappedWriter

type CappedWriter struct {
	Buffer   *bytes.Buffer
	MaxBytes int
}

CappedWriter implements a buffer that stores up to MaxBytes bytes. Returns ErrBufferFull on overflowing writes.

func (*CappedWriter) Bytes

func (cw *CappedWriter) Bytes() []byte

Bytes returns the contents of the buffer.

func (*CappedWriter) Close

func (cw *CappedWriter) Close() error

Close is a noop method so that you can use CappedWriter as an io.WriteCloser.

func (*CappedWriter) IsFull

func (cw *CappedWriter) IsFull() bool

IsFull indicates whether the buffer is full.

func (*CappedWriter) String

func (cw *CappedWriter) String() string

String return the contents of the buffer as a string.

func (*CappedWriter) Write

func (cw *CappedWriter) Write(in []byte) (int, error)

Write writes to the buffer. An error is returned if the buffer is full.

type ClientOptions

type ClientOptions struct {
	BinaryPath          string
	Type                string
	Host                string
	Port                int
	CredentialsFilePath string
}

ClientOptions represents the options to connect the CLI client to the Jasper service.

func (*ClientOptions) Validate

func (opts *ClientOptions) Validate() error

Validate checks that the binary path is set and it is a recognized Jasper client type.

type CompleteResponse

type CompleteResponse struct {
	OutcomeResponse `json:"outcome"`
	Complete        bool `json:"complete,omitempty"`
}

CompleteResponse represents CLI-specific output containing the request outcome and whether the process is complete or not.

func ExtractCompleteResponse

func ExtractCompleteResponse(input []byte) (CompleteResponse, error)

ExtractCompleteResponse unmarshals the input bytes into a CompleteResponse and checks if the request was successful.

type EventInput

type EventInput struct {
	Name string `json:"name"`
}

EventInput represents the CLI-specific input to signal a named event.

func (*EventInput) Validate

func (e *EventInput) Validate() error

Validate checks that the event name is set.

type FilterInput

type FilterInput struct {
	Filter options.Filter
}

FilterInput represents the CLI-specific input to filter processes.

func (*FilterInput) Validate

func (in *FilterInput) Validate() error

Validate checks that the jasper.Filter is a recognized filter.

type IDInput

type IDInput struct {
	ID string `json:"id"`
}

IDInput represents CLI-specific input representing a Jasper process ID.

func (*IDInput) Validate

func (in *IDInput) Validate() error

Validate checks that the Jasper process ID is non-empty.

type IDResponse

type IDResponse struct {
	OutcomeResponse `json:"outcome"`
	ID              string `json:"id,omitempty"`
}

IDResponse describes the structure of a wrapped Jasper process ID specific command as a response for the CLI.

func ExtractIDResponse

func ExtractIDResponse(input []byte) (IDResponse, error)

ExtractIDResponse unmarshells an ID response from an unprocessed slice of bytes.

type InfoResponse

type InfoResponse struct {
	OutcomeResponse `json:"outcome"`
	Info            jasper.ProcessInfo `json:"info,omitempty"`
}

InfoResponse represents represents CLI-specific output containing the request outcome and process information.

func ExtractInfoResponse

func ExtractInfoResponse(input []byte) (InfoResponse, error)

ExtractInfoResponse unmarshals the input bytes into an InfoResponse and checks if the request was successful.

type InfosResponse

type InfosResponse struct {
	OutcomeResponse `json:"outcome"`
	Infos           []jasper.ProcessInfo `json:"infos,omitempty"`
}

InfosResponse represents CLI-specific output containing the request outcome and information for multiple processes.

func ExtractInfosResponse

func ExtractInfosResponse(input []byte) (InfosResponse, error)

ExtractInfosResponse unmarshals the input bytes into a TagsResponse and checks if the request was successful.

type LogStreamInput

type LogStreamInput struct {
	ID    string `json:"id"`
	Count int    `json:"count"`
}

LogStreamInput represents the CLI-specific input to stream in-memory logs.

func (*LogStreamInput) Validate

func (in *LogStreamInput) Validate() error

Validate checks that the number of logs requested is positive.

type LogStreamResponse

type LogStreamResponse struct {
	OutcomeResponse  `json:"outcome"`
	jasper.LogStream `json:"log_stream,omitempty"`
}

LogStreamResponse represents CLI-specific output containing the log stream data.

func ExtractLogStreamResponse

func ExtractLogStreamResponse(input []byte) (LogStreamResponse, error)

ExtractLogStreamResponse unmarshals the input bytes into a LogStreamResponse and checks if the request was successful.

type LoggingCacheCreateInput

type LoggingCacheCreateInput struct {
	ID     string         `json:"id"`
	Output options.Output `json:"options"`
}

LoggingCacheCreateInput represents CLI-specific input to create a cached logger.

func (*LoggingCacheCreateInput) Validate

func (in *LoggingCacheCreateInput) Validate() error

Validate checks that a cached logger ID has been given and the logger options are valid.

type LoggingCacheLenResponse

type LoggingCacheLenResponse struct {
	OutcomeResponse `json:"outcome"`
	Length          int `json:"length"`
}

LoggingCacheLenResponse represents CLI-specific output describing the number of cached loggers.

func ExtractLoggingCacheLenResponse

func ExtractLoggingCacheLenResponse(input json.RawMessage) (LoggingCacheLenResponse, error)

ExtractLoggingCacheLenResponse unmarshals the input bytes into a LoggingCacheLenResponse and checks if the request was successful.

type LoggingCachePruneInput

type LoggingCachePruneInput struct {
	LastAccessed time.Time `json:"last_accessed"`
}

LoggingCachePruneInput represents CLI-specific input to prune the loggers that were accessed before the given time.

func (*LoggingCachePruneInput) Validate

func (in *LoggingCachePruneInput) Validate() error

Validate is a no-op.

type OutcomeResponse

type OutcomeResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message,omitempty"`
}

OutcomeResponse represents CLI-specific output describing if the request was processed successfully and if not, the associated error message. For other responses that compose OutcomeResponse, their results are valid only if Success is true.

func ExtractOutcomeResponse

func ExtractOutcomeResponse(input []byte) (OutcomeResponse, error)

ExtractOutcomeResponse unmarshals the input bytes into an OutcomeResponse and checks if the request was successful.

func (OutcomeResponse) ErrorMessage

func (resp OutcomeResponse) ErrorMessage() string

ErrorMessage returns the error message if the request was not successfully processed.

func (OutcomeResponse) Successful

func (resp OutcomeResponse) Successful() bool

Successful returns whether the request was successfully processed.

type RunningResponse

type RunningResponse struct {
	OutcomeResponse `json:"outcome"`
	Running         bool `json:"running,omitempty"`
}

RunningResponse represents CLI-specific output containing the request outcome and whether the process is running or not.

func ExtractRunningResponse

func ExtractRunningResponse(input []byte) (RunningResponse, error)

ExtractRunningResponse unmarshals the input bytes into a RunningResponse and checks if the request was successful.

type ScriptingOptions

type ScriptingOptions struct {
	ImplementationType string          `json:"type"`
	Payload            json.RawMessage `json:"payload"`
}

ScriptingOptions is a way to serialize implementations of the options.ScriptingHarness type by wrapping a type name for the implementation name to pass to the factory.

func BuildScriptingOptions

func BuildScriptingOptions(in options.ScriptingHarness) (*ScriptingOptions, error)

BuildScriptingOptions constructs a ScriptingOptions value.

func (*ScriptingOptions) Export

func (opts *ScriptingOptions) Export() (options.ScriptingHarness, error)

Export builds a native scripting harness container.

func (*ScriptingOptions) Validate

func (opts *ScriptingOptions) Validate() error

Validate ensures that the ScriptingOptions instance is validated.

type ServiceStatus

type ServiceStatus string

ServiceStatus represents the state of the service.

const (
	ServiceRunning ServiceStatus = "running"
	ServiceStopped ServiceStatus = "stopped"
	ServiceInvalid ServiceStatus = "invalid"
	ServiceUnknown ServiceStatus = "unknown"
)

Constants representing the status of the service.

type ServiceStatusResponse

type ServiceStatusResponse struct {
	OutcomeResponse `json:"outcome"`
	Status          ServiceStatus `json:"status,omitempty"`
}

ServiceStatusResponse represents CLI-specific output containing the request outcome and the service status.

func ExtractServiceStatusResponse

func ExtractServiceStatusResponse(input []byte) (ServiceStatusResponse, error)

ExtractServiceStatusResponse unmarshals the input bytes into a ServiceStatusResponse and checks if the request was successful.

type SignalInput

type SignalInput struct {
	ID     string `json:"id"`
	Signal int    `json:"signal"`
}

SignalInput represents CLI-specific input to signal a Jasper process.

func (*SignalInput) Validate

func (in *SignalInput) Validate() error

Validate checks that the SignalInput has a non-empty Jasper process ID and positive Signal.

type SignalTriggerIDInput

type SignalTriggerIDInput struct {
	ID              string                 `json:"id"`
	SignalTriggerID jasper.SignalTriggerID `json:"signal_trigger_id"`
}

SignalTriggerIDInput represents CLI-specific input to attach a signal trigger to a Jasper process.

func (*SignalTriggerIDInput) Validate

func (in *SignalTriggerIDInput) Validate() error

Validate checks that the SignalTriggerIDInput has a non-empty Jasper process ID and a recognized signal trigger ID.

type TagIDInput

type TagIDInput struct {
	ID  string `json:"id"`
	Tag string `json:"tag"`
}

TagIDInput represents the CLI-specific input for a process with a given tag.

func (*TagIDInput) Validate

func (in *TagIDInput) Validate() error

Validate checks that the TagIDInput has a non-empty Jasper process ID and a non-empty tag.

type TagInput

type TagInput struct {
	Tag string `json:"tag"`
}

TagInput represents the CLI-specific input for process tags.

func (*TagInput) Validate

func (in *TagInput) Validate() error

Validate checks that the tag is non-empty.

type TagsResponse

type TagsResponse struct {
	OutcomeResponse `json:"outcome"`
	Tags            []string `json:"tags,omitempty"`
}

TagsResponse represents CLI-specific output containing the request outcome and tags.

func ExtractTagsResponse

func ExtractTagsResponse(input []byte) (TagsResponse, error)

ExtractTagsResponse unmarshals the input bytes into a TagsResponse and checks if the request was successful.

type Validator

type Validator interface {
	Validate() error
}

Validator represents an input that can be validated.

type WaitResponse

type WaitResponse struct {
	OutcomeResponse `json:"outcome"`
	ExitCode        int    `json:"exit_code,omitempty"`
	Error           string `json:"error,omitempty"`
}

WaitResponse represents CLI-specific output containing the request outcome, the wait exit code, and the error from wait.

func ExtractWaitResponse

func ExtractWaitResponse(input []byte) (WaitResponse, error)

ExtractWaitResponse unmarshals the input bytes into a WaitResponse and checks if the request was successful.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL