kappctl

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ConfigFile the default config file path
	ConfigFile = ".kappital/config"

	// DeployInstanceURL the url format for deploying the instance
	DeployInstanceURL = "%v/api/v1alpha1/servicebinding/%v/instance?cluster_name=%v"
	// DeployServiceURL the url format for deploying the service package into cluster
	DeployServiceURL = "%v/api/v1alpha1/servicebinding"

	// GetInstancesURL the url format for getting the instances from the cluster
	GetInstancesURL = "%v/api/v1alpha1/servicebinding/%v/instance"
	// GetServiceURL the url format for getting the service from the cluster
	GetServiceURL = "%v/api/v1alpha1/servicebinding%v?cluster_name=%v"
	// GetServicesURL the url format for getting the service list from the cluster
	GetServicesURL = "%v/api/v1alpha1/servicebinding?cluster_name=%v"

	// DeleteInstanceURL the url format for deleting the instance from the cluster
	DeleteInstanceURL = "%v/api/v1alpha1/servicebinding/%v/instance/%v?cluster_name=%v"
	// DeleteServiceURL the url format for deleting service
	DeleteServiceURL = "%v/api/v1alpha1/servicebinding/%v?cluster_name=%v"
)

Variables

View Source
var (
	// ManagerIPAddr the manager service ip address
	ManagerIPAddr = newInputFlag("manager-addr", "", "", "the ip Addr of kappital-manager")
	// ManagerHTTPSPort the manager https service port
	ManagerHTTPSPort = newInputFlag("manager-https-port", "", "", "the HTTPS Port of kappital-manager")
	// ManagerClientCertFile the manager certificate file path
	ManagerClientCertFile = newInputFlag("manager-client-cert", "", "", "the HTTPS client certificate file of kappital-manager")
	// ManagerClientKeyFile the manager key file path
	ManagerClientKeyFile = newInputFlag("manager-client-key", "", "", "the HTTPS client key file of kappital-manager")
	// ManagerCAFile the manager ca file path
	ManagerCAFile = newInputFlag("manager-ca", "", "", "the HTTPS ca file for kappital-manager")
	// ManagerSkipVerify the manager skip verify controller
	ManagerSkipVerify = newInputFlag("manager-skip-verify", "", false, "connect to kappital-manager need to skip verify")
	// OutputFormat the output result format of the result, now only offer yaml and json
	OutputFormat = newInputFlag("output", "o", "", "the output format of the queried resource, can be yaml or json")
	// Cluster name of service and service instance deployed
	Cluster = newInputFlag("cluster", "c", apis.DefaultCluster, "the cluster scope of the Cloud Native Service")
	// GetAll service or instance from cluster
	GetAll = newInputFlag("all", "A", false, `query resources across all repos/clusters. When this flag is set, --repo or --cluster flag will HAS NO EFFECT`)
	// Namespace of the service or service instance deployed
	Namespace = newInputFlag("namespace", "n", apis.DefaultNamespace, "the namespace of the specified instance")
	// ServiceName the name of deployed or will deploy service
	ServiceName = newInputFlag("service", "s", "", "the cloud native service name")
	// InstanceName the name of deployed or will deploy instance
	InstanceName = newInputFlag("instance", "i", "", "the cloud native service instance name")
	// FilePath of the instance file
	FilePath = newInputFlag("file", "f", "", "the custom resource file path")
	// FileName of the directory name of the kappital package
	FileName = newInputFlag("name", "", "kappital-demo", "the kappital package name")
	// PackageVersion of the kappital
	PackageVersion = newInputFlag("version", "v", "0.1.0", "the kappital package version")
	// PackageDir of Cloud Native Package
	PackageDir = newInputFlag("dir", "d", "", "the Cloud Native Package Path")
)

Functions

func GetAgeOutput

func GetAgeOutput(timestamp time.Time) string

GetAgeOutput obtains the creation time with the hour, minute, and second.

func IsInputValidate

func IsInputValidate(inputs map[string]interface{}) error

IsInputValidate does the input arguments is valid or not, such as the max length of string should be 64 bytes.

func OutputYAMLOrJSONString

func OutputYAMLOrJSONString(buf []byte, format string) error

OutputYAMLOrJSONString output the buf as json or yaml from the format type

func TableFormatter

func TableFormatter(slice []interface{})

TableFormatter format the table

Types

type Config

type Config struct {
	ManagerHTTPSServer           string `json:"manager-https-server,omitempty"`
	ManagerClientCertificateData string `json:"manager-client-certificate-data,omitempty"`
	ManagerClientKeyData         string `json:"manager-client-key-data,omitempty"`
	ManagerCA                    string `json:"manager-ca,omitempty"`
	ManagerSkipVerify            bool   `json:"manager-skip-verify,omitempty"`
}

Config the address and port of the manager

func GetConfig

func GetConfig() (*Config, error)

GetConfig get the manager information from config file

func (Config) BuildManagerURL

func (c Config) BuildManagerURL(urlFormat string, args []interface{}) string

BuildManagerURL build the manager http/https request

type KappCtl

type KappCtl interface {
	NewCommand() *cobra.Command
	PreRunE(args []string) error
	RunE() error
}

KappCtl interface of all commands

Jump to

Keyboard shortcuts

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