Documentation
¶
Overview ¶
Copyright 2019 GramLabs, Inc.
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.
Index ¶
- func CheckErr(err error)
- func IsNoPrinterError(err error) bool
- type CSVPrinter
- type ConfigFlags
- type Factory
- type IOStreams
- type JSONPrinter
- type JSONYAMLPrintFlags
- type Kubectl
- type NoPrinterError
- type PrintFlags
- type ResourcePrinter
- type RuntimeObjectTableMeta
- type ServerFlags
- type TableMeta
- type TablePrintFlags
- type TablePrinter
- type YAMLPrinter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckErr ¶
func CheckErr(err error)
CheckErr ensures the supplied error is reported and handled correctly. Errors may be reported and/or may cause the process to exit.
func IsNoPrinterError ¶ added in v1.1.1
Types ¶
type CSVPrinter ¶ added in v1.1.1
type CSVPrinter struct {
// contains filtered or unexported fields
}
type ConfigFlags ¶
func NewConfigFlags ¶
func NewConfigFlags() *ConfigFlags
func (*ConfigFlags) AddFlags ¶
func (f *ConfigFlags) AddFlags(flags *pflag.FlagSet)
func (*ConfigFlags) ToRESTConfig ¶
func (f *ConfigFlags) ToRESTConfig() (*rest.Config, error)
func (*ConfigFlags) ToRawKubeConfigLoader ¶ added in v1.1.2
func (f *ConfigFlags) ToRawKubeConfigLoader() clientcmd.ClientConfig
type Factory ¶
type Factory interface {
ToRawKubeConfigLoader() clientcmd.ClientConfig
ToRESTConfig() (*rest.Config, error)
ToClientConfig() (*viper.Viper, error)
KubernetesClientSet() (*kubernetes.Clientset, error)
RedSkyClientSet() (*redskykube.Clientset, error)
RedSkyAPI() (redsky.API, error)
}
func NewFactory ¶
func NewFactory(cf *ConfigFlags, sf *ServerFlags) Factory
type JSONPrinter ¶ added in v1.1.1
type JSONPrinter struct{}
type JSONYAMLPrintFlags ¶ added in v1.1.1
type JSONYAMLPrintFlags struct{}
func NewJSONYAMLPrintFlags ¶ added in v1.1.1
func NewJSONYAMLPrintFlags() *JSONYAMLPrintFlags
func (*JSONYAMLPrintFlags) AddFlags ¶ added in v1.1.1
func (f *JSONYAMLPrintFlags) AddFlags(cmd *cobra.Command)
func (*JSONYAMLPrintFlags) AllowedFormats ¶ added in v1.1.1
func (f *JSONYAMLPrintFlags) AllowedFormats() []string
func (*JSONYAMLPrintFlags) ToPrinter ¶ added in v1.1.1
func (f *JSONYAMLPrintFlags) ToPrinter(outputFormat string) (ResourcePrinter, error)
type Kubectl ¶ added in v1.2.3
type Kubectl struct {
Bin string
}
func NewKubectl ¶ added in v1.2.3
func NewKubectl() *Kubectl
type NoPrinterError ¶ added in v1.1.1
func (NoPrinterError) Error ¶ added in v1.1.1
func (e NoPrinterError) Error() string
type PrintFlags ¶ added in v1.1.1
type PrintFlags struct {
JSONYAMLPrintFlags *JSONYAMLPrintFlags
TablePrintFlags *TablePrintFlags
OutputFormat *string
}
func NewPrintFlags ¶ added in v1.1.1
func NewPrintFlags(meta TableMeta) *PrintFlags
func (*PrintFlags) AddFlags ¶ added in v1.1.1
func (f *PrintFlags) AddFlags(cmd *cobra.Command)
func (*PrintFlags) AllowedFormats ¶ added in v1.1.1
func (f *PrintFlags) AllowedFormats() []string
func (*PrintFlags) ToPrinter ¶ added in v1.1.1
func (f *PrintFlags) ToPrinter() (ResourcePrinter, error)
type ResourcePrinter ¶ added in v1.1.1
type RuntimeObjectTableMeta ¶ added in v1.1.4
type RuntimeObjectTableMeta interface {
ExtractValue(obj runtime.Object, column string) (string, error)
Allow(outputFormat string) bool
Columns(outputFormat string) []string
Header(outputFormat string, column string) string
}
RuntimeObjectTableMeta is a subset of functionality needed for runtime.Object
type ServerFlags ¶
type ServerFlags struct {
Address *string
}
func NewServerFlags ¶
func NewServerFlags() *ServerFlags
func (*ServerFlags) AddFlags ¶
func (f *ServerFlags) AddFlags(flags *pflag.FlagSet)
func (*ServerFlags) ToClientConfig ¶
func (f *ServerFlags) ToClientConfig() (*viper.Viper, error)
type TableMeta ¶ added in v1.1.1
type TableMeta interface {
IsListType(obj interface{}) bool
ExtractList(obj interface{}) ([]interface{}, error)
ExtractValue(obj interface{}, column string) (string, error)
Allow(outputFormat string) bool
Columns(outputFormat string) []string
Header(outputFormat string, column string) string
}
func NewTableMeta ¶ added in v1.1.4
func NewTableMeta(rt RuntimeObjectTableMeta) TableMeta
type TablePrintFlags ¶ added in v1.1.1
func NewTablePrintFlags ¶ added in v1.1.1
func NewTablePrintFlags(meta TableMeta) *TablePrintFlags
func (*TablePrintFlags) AddFlags ¶ added in v1.1.1
func (f *TablePrintFlags) AddFlags(cmd *cobra.Command)
func (*TablePrintFlags) AllowedFormats ¶ added in v1.1.1
func (f *TablePrintFlags) AllowedFormats() []string
func (*TablePrintFlags) ToPrinter ¶ added in v1.1.1
func (f *TablePrintFlags) ToPrinter(outputFormat string) (ResourcePrinter, error)
type TablePrinter ¶ added in v1.1.1
type TablePrinter struct {
// contains filtered or unexported fields
}
type YAMLPrinter ¶ added in v1.1.1
type YAMLPrinter struct{}