result

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright 2020 The Operator-SDK Authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

TODO: Move the above implementation to the operator-frameowrk/api project to allow its re-usage. Any validator and SDK would ought to leverage on that.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

TODO: Move the above implementation to the operator-frameowrk/api project to allow its re-usage. Any validator and SDK would ought to leverage on that.

Index

Constants

View Source
const (
	JSONAlpha1 = "json-alpha1"
	Text       = "text"
)

Variables

This section is empty.

Functions

func NewLoggerTo

func NewLoggerTo(w io.Writer) *log.Logger

NewLoggerTo returns a logger that writes logs to w.

Types

type Result

type Result struct {
	Passed  bool     `json:"passed"`
	Outputs []output `json:"outputs"`
}

Result represents the final result

func NewResult

func NewResult() *Result

NewResult return a new result object which starts with passed == true since has no errors

func (*Result) AddError

func (o *Result) AddError(err error)

AddError will add a log to the result with the Error Level

func (*Result) AddInfo

func (o *Result) AddInfo(msg string)

AddInfo will add a log to the result with the Info Level

func (*Result) AddManifestResults

func (o *Result) AddManifestResults(results ...apierrors.ManifestResult)

AddManifestResults adds warnings and errors in results to Results.

func (*Result) AddWarn

func (o *Result) AddWarn(err error)

AddWarn will add a log to the result with the Warn Level

func (*Result) PrintWithFormat

func (o *Result) PrintWithFormat(format string) (err error)

PrintWithFormat prints output to w in format, and exits if some object in output is not in a passing state.

Jump to

Keyboard shortcuts

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