command

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultInitialVersion    = "v0.9.0"
	DefaultImagePullPolicy   = "Always"
	DefaultResourceLimitsCpu = "500m"
	DefaultResourceLimitsMem = "1Gi"
)
View Source
const (
	AWSCredentialType    = "aws"
	GCloudCredentialType = "gcloud"
)
View Source
const (
	RespCodeOK          int32 = 200
	DefaultOperatorPort       = 30009
	HttpPrefix                = "http://"
	BaseUrl                   = "/api/v1"
)
View Source
const (
	CoreComponentImagePullPolicyAnnotation = "core.vanus.ai/image-pull-policy"
	// Etcd
	CoreComponentEtcdPortClientAnnotation        = "core.vanus.ai/etcd-port-client"
	CoreComponentEtcdPortPeerAnnotation          = "core.vanus.ai/etcd-port-peer"
	CoreComponentEtcdReplicasAnnotation          = "core.vanus.ai/etcd-replicas"
	CoreComponentEtcdStorageSizeAnnotation       = "core.vanus.ai/etcd-storage-size"
	CoreComponentEtcdStorageClassAnnotation      = "core.vanus.ai/etcd-storage-class"
	CoreComponentEtcdResourceLimitsCpuAnnotation = "core.vanus.ai/etcd-resource-limits-cpu"
	CoreComponentEtcdResourceLimitsMemAnnotation = "core.vanus.ai/etcd-resource-limits-mem"
	// Controller
	CoreComponentControllerSvcPortAnnotation           = "core.vanus.ai/controller-service-port"
	CoreComponentControllerReplicasAnnotation          = "core.vanus.ai/controller-replicas"
	CoreComponentControllerSegmentCapacityAnnotation   = "core.vanus.ai/controller-segment-capacity"
	CoreComponentControllerResourceLimitsCpuAnnotation = "core.vanus.ai/controller-resource-limits-cpu"
	CoreComponentControllerResourceLimitsMemAnnotation = "core.vanus.ai/controller-resource-limits-mem"
	// Root Controller
	CoreComponentRootControllerSvcPortAnnotation = "core.vanus.ai/root-controller-service-port"
	// Store
	CoreComponentStoreReplicasAnnotation          = "core.vanus.ai/store-replicas"
	CoreComponentStoreStorageSizeAnnotation       = "core.vanus.ai/store-storage-size"
	CoreComponentStoreStorageClassAnnotation      = "core.vanus.ai/store-storage-class"
	CoreComponentStoreResourceLimitsCpuAnnotation = "core.vanus.ai/store-resource-limits-cpu"
	CoreComponentStoreResourceLimitsMemAnnotation = "core.vanus.ai/store-resource-limits-mem"
	// Gateway
	CoreComponentGatewayPortProxyAnnotation           = "core.vanus.ai/gateway-port-proxy"
	CoreComponentGatewayPortCloudEventsAnnotation     = "core.vanus.ai/gateway-port-cloudevents"
	CoreComponentGatewayNodePortProxyAnnotation       = "core.vanus.ai/gateway-nodeport-proxy"
	CoreComponentGatewayNodePortCloudEventsAnnotation = "core.vanus.ai/gateway-nodeport-cloudevents"
	CoreComponentGatewayReplicasAnnotation            = "core.vanus.ai/gateway-replicas"
	CoreComponentGatewayResourceLimitsCpuAnnotation   = "core.vanus.ai/gateway-resource-limits-cpu"
	CoreComponentGatewayResourceLimitsMemAnnotation   = "core.vanus.ai/gateway-resource-limits-mem"
	// Trigger
	CoreComponentTriggerReplicasAnnotation          = "core.vanus.ai/trigger-replicas"
	CoreComponentTriggerResourceLimitsCpuAnnotation = "core.vanus.ai/trigger-resource-limits-cpu"
	CoreComponentTriggerResourceLimitsMemAnnotation = "core.vanus.ai/trigger-resource-limits-mem"
	// Timer
	CoreComponentTimerReplicasAnnotation          = "core.vanus.ai/timer-replicas"
	CoreComponentTimerTimingWheelTickAnnotation   = "core.vanus.ai/timer-timingwheel-tick"
	CoreComponentTimerTimingWheelSizeAnnotation   = "core.vanus.ai/timer-timingwheel-size"
	CoreComponentTimerTimingWheelLayersAnnotation = "core.vanus.ai/timer-timingwheel-layers"
	CoreComponentTimerResourceLimitsCpuAnnotation = "core.vanus.ai/timer-resource-limits-cpu"
	CoreComponentTimerResourceLimitsMemAnnotation = "core.vanus.ai/timer-resource-limits-mem"
)

Annotations supported by Core

View Source
const (
	ConnectorDeploymentReplicasAnnotation = "connector.vanus.ai/deployment-replicas"
	ConnectorServiceTypeAnnotation        = "connector.vanus.ai/service-type"
	ConnectorServicePortAnnotation        = "connector.vanus.ai/service-port"
	ConnectorNetworkHostDomainAnnotation  = "connector.vanus.ai/network-host-domain"
)

Annotations supported by Connector

View Source
const (

	// DNS1123SubdomainMaxLength is a subdomain's max length in DNS (RFC 1123)
	DNS1123SubdomainMaxLength int = 253
)
View Source
const (
	FormatJSON = "json"
)

Variables

This section is empty.

Functions

func DestroyGatewayClient

func DestroyGatewayClient()

func Error

func Error(err error) string

func InitGatewayClient

func InitGatewayClient(cmd *cobra.Command)

func IsDNS1123Subdomain

func IsDNS1123Subdomain(value string) bool

IsDNS1123Subdomain tests for a string that conforms to the definition of a subdomain in DNS (RFC 1123).

func IsFormatJSON

func IsFormatJSON(cmd *cobra.Command) bool

func LoadConfig

func LoadConfig(filename string, config interface{}) error

func NewClusterCommand

func NewClusterCommand() *cobra.Command

func NewConnectorCommand

func NewConnectorCommand() *cobra.Command

func NewEventCommand

func NewEventCommand() *cobra.Command

func NewEventbusCommand

func NewEventbusCommand() *cobra.Command

func NewNamespaceCommand

func NewNamespaceCommand() *cobra.Command

func NewPermissionCommand

func NewPermissionCommand() *cobra.Command

func NewSubscriptionCommand

func NewSubscriptionCommand() *cobra.Command

func NewTokenCommand

func NewTokenCommand() *cobra.Command

func NewUserCommand

func NewUserCommand() *cobra.Command

Types

type ClusterCreate

type ClusterCreate struct {
	Version     string            `json:"version,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty"`
}

type ClusterDelete

type ClusterDelete struct {
	Force *bool `json:"force,omitempty"`
}

type ClusterInfo

type ClusterInfo struct {
	Status  string `json:"status,omitempty"`
	Version string `json:"version,omitempty"`
}

type ClusterOKBody

type ClusterOKBody struct {
	Code    *int32       `json:"code"`
	Data    *ClusterInfo `json:"data"`
	Message *string      `json:"message"`
}

type ClusterPatch

type ClusterPatch struct {
	Version     string            `json:"version,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty"`
}

type ClusterSpec

type ClusterSpec struct {
	Version         *string     `yaml:"version"`
	ImagePullPolicy *string     `yaml:"image_pull_policy"`
	Etcd            *Etcd       `yaml:"etcd"`
	Controller      *Controller `yaml:"controller"`
	Store           *Store      `yaml:"store"`
	Gateway         *Gateway    `yaml:"gateway"`
	Trigger         *Trigger    `yaml:"trigger"`
	Timer           *Timer      `yaml:"timer"`
}

type ConnectorCreate

type ConnectorCreate struct {
	Kind        string                 `json:"kind,omitempty"`
	Name        string                 `json:"name,omitempty"`
	Type        string                 `json:"type,omitempty"`
	Version     string                 `json:"version,omitempty"`
	Config      map[string]interface{} `json:"config,omitempty"`
	Annotations map[string]string      `json:"annotations,omitempty"`
}

type ConnectorDelete

type ConnectorDelete struct {
	Force *bool `json:"force,omitempty"`
}

type ConnectorInfo

type ConnectorInfo struct {
	Kind    string `json:"kind,omitempty"`
	Name    string `json:"name,omitempty"`
	Type    string `json:"type,omitempty"`
	Version string `json:"version,omitempty"`
	Status  string `json:"status,omitempty"`
	Reason  string `json:"reason,omitempty"`
}

type ConnectorOKBody

type ConnectorOKBody struct {
	Code    *int32         `json:"code"`
	Data    *ConnectorInfo `json:"data"`
	Message *string        `json:"message"`
}

type ConnectorSpec

type ConnectorSpec struct {
	Kind    string
	Type    string
	Version string
}

type Controller

type Controller struct {
	Ports           *ControllerPorts `yaml:"ports"`
	Replicas        *int32           `yaml:"replicas"`
	SegmentCapacity *string          `yaml:"segment_capacity"`
	Resources       *Resources       `yaml:"resources"`
}

type ControllerPorts

type ControllerPorts struct {
	Controller     *int32 `yaml:"controller"`
	RootController *int32 `yaml:"root_controller"`
}

type Etcd

type Etcd struct {
	Ports        *EtcdPorts `yaml:"ports"`
	Replicas     *int32     `yaml:"replicas"`
	StorageSize  *string    `yaml:"storage_size"`
	StorageClass *string    `yaml:"storage_class"`
	Resources    *Resources `yaml:"resources"`
}

type EtcdPorts

type EtcdPorts struct {
	Client *int32 `yaml:"client"`
	Peer   *int32 `yaml:"peer"`
}

type Gateway

type Gateway struct {
	Ports     *GatewayPorts     `yaml:"ports"`
	NodePorts *GatewayNodePorts `yaml:"nodeports"`
	Replicas  *int32            `yaml:"replicas"`
	Resources *Resources        `yaml:"resources"`
}

type GatewayNodePorts

type GatewayNodePorts struct {
	Proxy       *int32 `yaml:"proxy"`
	CloudEvents *int32 `yaml:"cloudevents"`
}

type GatewayPorts

type GatewayPorts struct {
	Proxy       *int32 `yaml:"proxy"`
	CloudEvents *int32 `yaml:"cloudevents"`
	SinkProxy   *int32 `yaml:"sink_proxy"`
}

type GlobalFlags

type GlobalFlags struct {
	Endpoint         string
	OperatorEndpoint string
	Debug            bool
	ConfigFile       string
	Format           string
	Token            string
}

type ListConnectorOKBody

type ListConnectorOKBody struct {
	Code    *int32           `json:"code"`
	Data    []*ConnectorInfo `json:"data"`
	Message *string          `json:"message"`
}

type QueryOutput

type QueryOutput struct {
	Eventlog string `json:"eventlog"`
	Offset   int64  `json:"offset"`
	Event    string `json:"event"`
}

type Resources

type Resources struct {
	LimitsCpu *string `yaml:"limits_cpu"`
	LimitsMem *string `yaml:"limits_mem"`
}

type Store

type Store struct {
	Replicas     *int32     `yaml:"replicas"`
	StorageSize  *string    `yaml:"storage_size"`
	StorageClass *string    `yaml:"storage_class"`
	Resources    *Resources `yaml:"resources"`
}

type Timer

type Timer struct {
	Replicas    *int32       `yaml:"replicas"`
	TimingWheel *TimingWheel `yaml:"timingwheel"`
	Resources   *Resources   `yaml:"resources"`
}

type TimingWheel

type TimingWheel struct {
	Tick   *int32 `yaml:"tick"`
	Size   *int32 `yaml:"wheel_size"`
	Layers *int32 `yaml:"layers"`
}

type Trigger

type Trigger struct {
	Replicas  *int32     `yaml:"replicas"`
	Resources *Resources `yaml:"resources"`
}

Jump to

Keyboard shortcuts

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