format

package
v0.0.35 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: BSD-3-Clause Imports: 30 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

SPDX-FileCopyrightText: 2026 Outscale SAS <opensource@outscale.com> SPDX-License-Identifier: BSD-3-Clause

SPDX-FileCopyrightText: 2026 Outscale SAS <opensource@outscale.com> SPDX-License-Identifier: BSD-3-Clause

SPDX-FileCopyrightText: 2026 Outscale SAS <opensource@outscale.com> SPDX-License-Identifier: BSD-3-Clause

SPDX-FileCopyrightText: 2026 Outscale SAS <opensource@outscale.com> SPDX-License-Identifier: BSD-3-Clause

SPDX-FileCopyrightText: 2026 Outscale SAS <opensource@outscale.com> SPDX-License-Identifier: BSD-3-Clause

SPDX-FileCopyrightText: 2026 Outscale SAS <opensource@outscale.com> SPDX-License-Identifier: BSD-3-Clause

SPDX-FileCopyrightText: 2026 Outscale SAS <opensource@outscale.com> SPDX-License-Identifier: BSD-3-Clause

SPDX-FileCopyrightText: 2026 Outscale SAS <opensource@outscale.com> SPDX-License-Identifier: BSD-3-Clause

SPDX-FileCopyrightText: 2026 Outscale SAS <opensource@outscale.com> SPDX-License-Identifier: BSD-3-Clause

SPDX-FileCopyrightText: 2026 Outscale SAS <opensource@outscale.com> SPDX-License-Identifier: BSD-3-Clause

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTerminal added in v0.0.14

func IsTerminal(w io.Writer) bool

Types

type Body added in v0.0.14

type Body struct{}

func (Body) Error added in v0.0.14

func (Body) Error(ctx context.Context, v any) error

func (Body) Format added in v0.0.14

func (Body) Format(ctx context.Context, w io.Writer, v any) (err error)

type CSVFormatter added in v0.0.16

type CSVFormatter struct{}

func (CSVFormatter) Format added in v0.0.16

func (f CSVFormatter) Format(ctx context.Context, w io.Writer, headers []string, data [][]string) error

type Interface

type Interface interface {
	Format(ctx context.Context, w io.Writer, v any) error
	Error(ctx context.Context, v any) error
}

type JSON

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

func NewJSON added in v0.0.32

func NewJSON(style string) JSON

func (JSON) Error

func (j JSON) Error(ctx context.Context, v any) error

func (JSON) Format

func (j JSON) Format(ctx context.Context, w io.Writer, v any) error

type None

type None struct{}

func (None) Error

func (None) Error(ctx context.Context, v any) error

func (None) Format

func (None) Format(ctx context.Context, _ io.Writer, _ any) error

type PrintPath added in v0.0.33

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

func NewPrintPath added in v0.0.33

func NewPrintPath(fmter Interface) PrintPath

func (PrintPath) Error added in v0.0.33

func (p PrintPath) Error(ctx context.Context, v any) error

func (PrintPath) Format added in v0.0.33

func (p PrintPath) Format(ctx context.Context, w io.Writer, v any) error

type Single

type Single struct {
	ForFormat Interface
}

func (Single) Error

func (s Single) Error(ctx context.Context, v any) error

func (Single) Format

func (s Single) Format(ctx context.Context, w io.Writer, v any) error

type Success added in v0.0.12

type Success struct{}

func (Success) Error added in v0.0.12

func (Success) Error(ctx context.Context, v any) error

func (Success) Format added in v0.0.12

func (Success) Format(ctx context.Context, w io.Writer, v any) error

type TableFormatter added in v0.0.16

type TableFormatter struct{}

func (TableFormatter) Format added in v0.0.16

func (f TableFormatter) Format(ctx context.Context, w io.Writer, headers []string, data [][]string) error

type Tabular added in v0.0.16

type Tabular struct {
	Sort    bool
	Columns config.Columns

	Formatter TabularFormatter
}

func (Tabular) Error added in v0.0.16

func (Tabular) Error(ctx context.Context, v any) error

func (Tabular) Format added in v0.0.16

func (t Tabular) Format(ctx context.Context, w io.Writer, v any) error

type TabularFormatter added in v0.0.16

type TabularFormatter interface {
	Format(ctx context.Context, w io.Writer, header []string, data [][]string) error
}

type Text added in v0.0.21

type Text struct{}

func (Text) Error added in v0.0.21

func (Text) Error(ctx context.Context, v any) error

func (Text) Format added in v0.0.21

func (Text) Format(ctx context.Context, w io.Writer, v any) error

type YAML

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

func NewYAML added in v0.0.32

func NewYAML(style string, raw bool) YAML

func (YAML) Error

func (y YAML) Error(ctx context.Context, v any) error

func (YAML) Format

func (y YAML) Format(ctx context.Context, w io.Writer, v any) error

Jump to

Keyboard shortcuts

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