format

package
v1.0.25 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

* Copyright (C) 2016-Present Pivotal Software, Inc. All rights reserved. * * This program and the accompanying materials are made available under * the terms of the 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 * * https://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.

* Copyright (C) 2016-Present Pivotal Software, Inc. All rights reserved. * * This program and the accompanying materials are made available under * the terms of the 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 * * https://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.

Index

Constants

This section is empty.

Variables

View Source
var (
	Bold  func(format string, a ...interface{}) string = color.New(color.Bold).SprintfFunc()
	Cyan  func(format string, a ...interface{}) string = color.New(color.FgHiCyan).SprintfFunc()
	Green func(format string, a ...interface{}) string = color.New(color.FgGreen).SprintfFunc()
	Red   func(format string, a ...interface{}) string = color.New(color.FgRed).SprintfFunc()
)

Functions

func Diagnose

func Diagnose(message string, writer io.Writer, onFailure func())

func Max

func Max(x, y int) int

func RunAction

func RunAction(cliConnection plugin.CliConnection, message string, action Action, writer io.Writer, onFailure func())

Run a given Action with a given progress message, writing the output to the given writer and invoking a failure closure if an error occurs.

func RunActionQuietly

func RunActionQuietly(cliConnection plugin.CliConnection, action func() (string, error), writer io.Writer, onFailure func())

Run a given Action writing the output to the given writer and invoking a failure closure if an error occurs.

Types

type Action

type Action func(progressWriter io.Writer) (string, error)

An Action should write progress indications to the provided writer and should return any output on success as a string return value.

type Table

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

func (*Table) AddRow

func (t *Table) AddRow(row []string)

func (*Table) Entitle

func (t *Table) Entitle(headings []string)

func (*Table) String

func (t *Table) String() string

Jump to

Keyboard shortcuts

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