core

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIVersion = "v1"
)

Variables

This section is empty.

Functions

func Bind

func Bind(cmd *cobra.Command, command Command, options BindOptions)

func ParseIntegrationScopedName

func ParseIntegrationScopedName(name string) (string, string, bool)

func ParseYamlResourceHeaders

func ParseYamlResourceHeaders(raw []byte) (string, string, error)

Types

type BindOptions

type BindOptions struct {
	NewAPIClient        func() *openapi_client.APIClient
	DefaultOutputFormat func() string
}

type Command

type Command interface {
	Execute(ctx CommandContext) error
}

type CommandContext

type CommandContext struct {
	Context  context.Context
	Cmd      *cobra.Command
	Args     []string
	Logger   *log.Entry
	API      *openapi_client.APIClient
	Renderer Renderer
}

func NewCommandContext

func NewCommandContext(cmd *cobra.Command, args []string, options BindOptions) (CommandContext, error)

type OutputFormat

type OutputFormat string
const (
	OutputFormatText OutputFormat = "text"
	OutputFormatJSON OutputFormat = "json"
	OutputFormatYAML OutputFormat = "yaml"
)

type Renderer

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

func NewRenderer

func NewRenderer(rawFormat string, stdout io.Writer) (Renderer, error)

func (Renderer) Format

func (r Renderer) Format() OutputFormat

func (Renderer) IsText

func (r Renderer) IsText() bool

func (Renderer) Render

func (r Renderer) Render(value any) error

func (Renderer) RenderText

func (r Renderer) RenderText(render func(io.Writer) error) error

Jump to

Keyboard shortcuts

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