cmdutil

package
v1.0.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package cmdutil provides helper utilities and interfaces for working with command line tools

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertKVStringsToMap

func ConvertKVStringsToMap(values []string) map[string]string

ConvertKVStringsToMap converts a slice of "key=value" strings into a map.

func FormatDuration

func FormatDuration(d time.Duration) string

func FormatPhase

func FormatPhase(phase string) string

func ReadKVStringsMapFromLabel

func ReadKVStringsMapFromLabel(labels []string) map[string]string

ReadKVStringsMapFromLabel convers string slice into map

func Watch

func Watch(ctx context.Context, id string, wf WatchFunc) error

Types

type Codec

type Codec interface {
	Serializer
	Deserializer
}

func CodecFor

func CodecFor(s string) (Codec, error)

func NewJSONCodec

func NewJSONCodec() Codec

func NewYamlCodec

func NewYamlCodec() Codec

type Deserializer

type Deserializer interface {
	Deserialize(b []byte, m proto.Message) error
}

func DeserializerFor

func DeserializerFor(s string) (Deserializer, error)

type JSONCodec

type JSONCodec struct {
	*JSONSerializer
	*JSONDeserializer
}

type JSONDeserializer

type JSONDeserializer struct{}

func (*JSONDeserializer) Deserialize

func (d *JSONDeserializer) Deserialize(b []byte, m proto.Message) error

type JSONSerializer

type JSONSerializer struct{}

func (*JSONSerializer) Serialize

func (s *JSONSerializer) Serialize(m proto.Message) ([]byte, error)

type OutputFormat

type OutputFormat string
var (
	OutputFormatJSON  OutputFormat = "json"
	OutputFormatYAML  OutputFormat = "yaml"
	OutputFormatTable OutputFormat = "table"
)

type Serializer

type Serializer interface {
	Serialize(m proto.Message) ([]byte, error)
}

func SerializerFor

func SerializerFor(s string) (Serializer, error)

type StopFunc

type StopFunc func()

type SyncWriter

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

func (*SyncWriter) Write

func (sw *SyncWriter) Write(p []byte) (int, error)

type TableSerializer

type TableSerializer struct{}

func (*TableSerializer) Serialize

func (s *TableSerializer) Serialize(m proto.Message) ([]byte, error)

type WatchFunc

type WatchFunc func(StopFunc) error

type YamlCodec

type YamlCodec struct {
	*YamlSerializer
	*YamlDeserializer
}

type YamlDeserializer

type YamlDeserializer struct{}

func (*YamlDeserializer) Deserialize

func (d *YamlDeserializer) Deserialize(b []byte, m proto.Message) error

type YamlSerializer

type YamlSerializer struct{}

func (*YamlSerializer) Serialize

func (s *YamlSerializer) Serialize(m proto.Message) ([]byte, error)

Jump to

Keyboard shortcuts

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