machine

package
v0.0.29 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewErrUnsupportedEncodingFormat

func NewErrUnsupportedEncodingFormat(format pb.UI_Settings_Format) error

NewErrUnsupportedEncodingFormat returns a new unsupported encoding format error.

Types

type ErrJSON added in v0.0.29

type ErrJSON struct {
	Errors []string `json:"errors"`
}

type Opt

type Opt func(*View)

Opt is a functional option.

func WithUISettings

func WithUISettings(settings *pb.UI_Settings) Opt

WithUISettings configures the view with the UI settings.

type View

type View struct {
	// contains filtered or unexported fields
}

View is our basic terminal CLI view.

func New

func New(opts ...Opt) (*View, error)

New takes options and returns a new basic.View.

func (*View) Close

func (v *View) Close() error

Close closes any open file handles.

func (*View) Settings

func (v *View) Settings() *pb.UI_Settings

Settings returns the views UI settings.

func (*View) ShowDecode

func (v *View) ShowDecode(res *pb.DecodeResponse, incremental bool) error

ShowDecode shows the decode response unless it's a incremental update.

func (*View) ShowDiagnostics

func (v *View) ShowDiagnostics(diags []*pb.Diagnostic) error

ShowDiagnostics writes the given diagnostic to stdout in the formatted version.

func (*View) ShowError

func (v *View) ShowError(err error) error

ShowError writes the given error to stdout in the formatted version.

func (*View) ShowFormat

func (v *View) ShowFormat(cfg *pb.FormatRequest_Config, res *pb.FormatResponse) error

ShowFormat shows the output of a format request.

func (*View) ShowOperationEvent

func (v *View) ShowOperationEvent(*pb.Operation_Event)

ShowOperationEvent does nothing as the machine output doesn't stream events.

func (*View) ShowOperationResponse

func (v *View) ShowOperationResponse(res *pb.Operation_Response) error

ShowOperationResponse shows an operation response.

func (*View) ShowOperationResponses

func (v *View) ShowOperationResponses(res *pb.OperationResponses) error

ShowOperationResponses shows the results of multiple operations.

func (*View) ShowOutput

func (v *View) ShowOutput(out *pb.OperationResponses) error

ShowOutput shows output response.

func (*View) ShowSampleList

func (v *View) ShowSampleList(res *pb.ListSamplesResponse) error

ShowSampleList shows the a list of samples.

func (*View) ShowSampleObservation

func (v *View) ShowSampleObservation(res *pb.ObserveSampleResponse) error

ShowSample shows the sample observation.

func (*View) ShowScenarioList

func (v *View) ShowScenarioList(res *pb.ListScenariosResponse) error

ShowScenarioList shows the a list of scenarios.

func (*View) ShowScenarioOutline

func (v *View) ShowScenarioOutline(res *pb.OutlineScenariosResponse) error

ShowScenarioOutline shows the scenario outlines.

func (*View) ShowScenariosValidateConfig

func (v *View) ShowScenariosValidateConfig(res *pb.ValidateScenariosConfigurationResponse) error

ShowScenariosValidateConfig shows the validation response.

func (*View) ShowVersion

func (v *View) ShowVersion(all bool, res *pb.GetVersionResponse) error

ShowVersion shows the version information.

Jump to

Keyboard shortcuts

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