cliserv

package
v3.0.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2018 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Get = &cobra.Command{
	Use:     "service",
	Aliases: aliases,
	Short:   "shows service info",
	Long:    "chkit get service service_label [-o yaml/json] [-f output_file]",
	Example: "Shows service info",
	Run: func(cmd *cobra.Command, args []string) {
		serviceData, err := func() (model.Renderer, error) {
			switch len(args) {
			case 0:
				list, err := context.GlobalContext.Client.GetServiceList(context.GlobalContext.Namespace)
				return list, err
			case 1:
				svc, err := context.GlobalContext.Client.GetDeployment(context.GlobalContext.Namespace, args[0])
				return svc, err
			default:
				list, err := context.GlobalContext.Client.GetServiceList(context.GlobalContext.Namespace)
				var filteredList service.ServiceList
				names := strset.NewSet(args)
				for _, svc := range list {
					if names.Have(svc.Name) {
						filteredList = append(filteredList, svc)
					}
				}
				return filteredList, err
			}
		}()
		if err != nil {
			fmt.Println(err)
			return
		}
		if err := configuration.ExportData(serviceData, getServiceConfig.ExportConfig); err != nil {
			fmt.Println(err)
			return
		}

	},
}

Functions

func Create

func Create(ctx *context.Context) *cobra.Command

func Delete

func Delete(ctx *context.Context) *cobra.Command

Types

This section is empty.

Jump to

Keyboard shortcuts

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