models

package
v0.0.0-...-2601f63 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateEcstDiscoveryEvent

func CreateEcstDiscoveryEvent(eventType string, changeAction string, id string, data Data, workspaceId string, configId string) models.DiscoveryEvent

CreateEcstDiscoveryEvent ECST Discovery Items

func GenerateId

func GenerateId(workspaceId string, configId string, data Data) string

Types

type Cluster

type Cluster struct {
	Namespace   Namespace    `json:"namespace"`
	Deployments []Deployment `json:"deployments"`
	Name        string       `json:"clusterName"`
	Os          string       `json:"os"`
	K8sVersion  string       `json:"k8sVersion"`
	NoOfNodes   string       `json:"noOfNodes"`
}

type ClusterEcst

type ClusterEcst struct {
	Namespace   string           `json:"namespaceName"`
	Deployments []DeploymentEcst `json:"deployments"`
	Name        string           `json:"clusterName"`
	Os          string           `json:"os"`
	K8sVersion  string           `json:"k8sVersion"`
	NoOfNodes   string           `json:"noOfNodes"`
}

type Data

type Data struct {
	Cluster ClusterEcst `json:"cluster"`
}

type Deployment

type Deployment struct {
	Service        *Service             `json:"service"`
	Image          string               `json:"image"`
	DeploymentName string               `json:"deploymentName"`
	Labels         interface{}          `json:"labels"`
	Timestamp      string               `json:"time"`
	Properties     DeploymentProperties `json:"properties"`
}

type DeploymentEcst

type DeploymentEcst struct {
	ServiceName          string               `json:"serviceName"`
	Image                string               `json:"image"`
	DeploymentName       string               `json:"deploymentName"`
	Labels               interface{}          `json:"labels"`
	Timestamp            string               `json:"time"`
	DeploymentProperties DeploymentProperties `json:"deploymentProperties"`
}

type DeploymentProperties

type DeploymentProperties struct {
	UpdateStrategy string       `json:"updateStrategy"`
	Replicas       string       `json:"replicas"`
	K8sLimits      K8sResources `json:"k8sLimits"`
	K8sRequests    K8sResources `json:"k8sRequests"`
}

type EcstEventBuilder

type EcstEventBuilder interface {
	Header(header models.HeaderProperties) EcstEventBuilder
	Body(body models.DiscoveryBody) EcstEventBuilder

	Build() models.DiscoveryEvent
}

ECST Discovery Items

func NewEcstBuilder

func NewEcstBuilder() EcstEventBuilder

Discovery Event Builder

type K8sResources

type K8sResources struct {
	Cpu    string `json:"cpu"`
	Memory string `json:"memory"`
}

type Namespace

type Namespace struct {
	Name string `json:"name"`
}

type Service

type Service struct {
	Name string `json:"name"`
}

Jump to

Keyboard shortcuts

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