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, runId string, 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 {
	Name       string `json:"name"`
	OsImage    string `json:"os"`
	K8sVersion string `json:"k8sVersion"`
	NoOfNodes  int    `json:"noOfNodes"`
}

type CommandBuilder

type CommandBuilder interface {
	Header(header models.CommandProperties) CommandBuilder
	Body(body models.CommandBody) CommandBuilder

	Build() models.CommandEvent
}

func NewCommand

func NewCommand() CommandBuilder

Command Event Builder

type Containers

type Containers struct {
	Name        string       `json:"name"`
	Image       string       `json:"image"`
	Port        interface{}  `json:"port"`
	K8sLimits   K8sResources `json:"k8sLimits"`
	K8sRequests K8sResources `json:"k8sRequests"`
}

type Data

type Data struct {
	Workload      Workload `json:"workload"`
	NamespaceName string   `json:"namespaceName"`
	ServiceName   string   `json:"serviceName"`
	Cluster       Cluster  `json:"cluster"`
	Timestamp     string   `json:"timestamp"`
}

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

NewEcstBuilder Discovery Event Builder

type EcstWorkloadEventBuilder

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

	Build() models.DiscoveryEvent
}

type K8sResources

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

type Workload

type Workload struct {
	Name               string             `json:"name"`
	WorkloadType       string             `json:"type"`
	Labels             map[string]string  `json:"labels"`
	WorkloadProperties WorkloadProperties `json:"workloadProperties"`
}

type WorkloadProperties

type WorkloadProperties struct {
	Schedule       string     `json:"schedule"`
	Replicas       string     `json:"replicas"`
	UpdateStrategy string     `json:"updateStrategy"`
	Containers     Containers `json:"containers"`
}

Jump to

Keyboard shortcuts

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