types

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Compute       k8sResource = "Compute"
	BlockStorage  k8sResource = "BlockStorage"
	ObjectStorage k8sResource = "ObjectStorage"
	Lambda        k8sResource = "Lambda"
	Ci            k8sResource = "Ci"
)

Variables

View Source
var Stages = struct {
	Exists  stageTT `json:"exists"`
	Deleted stageTT `json:"deleted"`
}{
	Exists:  "EXISTS",
	Deleted: "DELETED",
}

Functions

func GetMsgKey

func GetMsgKey(c client.Object) string

Types

type K8sItem

type K8sItem struct {
	Type         k8sResource `json:"type"`
	Count        int         `json:"count,omitempty"`
	Plan         Plan        `json:"plan,omitempty"`
	IsShared     string      `json:"isShared,omitempty"`
	PlanQuantity float32     `json:"planQuantity,omitempty"`
}

func NewK8sItem

func NewK8sItem(obj client.Object, resType k8sResource, planQuantity float32, count int) K8sItem

type KlMetadata

type KlMetadata struct {
	ClusterId        string                  `json:"clusterId"`
	AccountId        string                  `json:"accountId"`
	ProjectId        string                  `json:"projectId"`
	ResourceId       string                  `json:"resourceId"`
	GroupVersionKind schema.GroupVersionKind `json:"groupVersionKind"`
	Labels           map[string]string       `json:"labels"`
	EnvironmentId    string                  `json:"environmentId"`
}

func ExtractMetadata

func ExtractMetadata(obj client.Object) KlMetadata

type MessageReply

type MessageReply struct {
	// ChildConditions []metav1.Condition `json:"childConditions,omitempty"`
	// Conditions      []metav1.Condition `json:"conditions,omitempty"`
	IsReady bool `json:"isReady"`
	// ToBeDeleted     bool               `json:"toBeDeleted,omitempty"`
	Key      string           `json:"key"`
	Billing  *ResourceBilling `json:"billing-watcher,omitempty"`
	Metadata KlMetadata       `json:"metadata,omitempty"`
	Stage    stageTT          `json:"stage"`
}

type Notifier

type Notifier struct {
	// contains filtered or unexported fields
}

func NewNotifier

func NewNotifier(clusterId string, producer redpanda.Producer, topic string) *Notifier

func (*Notifier) Notify

func (n *Notifier) Notify(ctx context.Context, key string, statusUpdate types.ResourceUpdate) error

func (*Notifier) Notify2

func (n *Notifier) Notify2(ctx context.Context, key string, metadata KlMetadata, status rApi.Status, stage stageTT) error

func (*Notifier) NotifyBilling

func (n *Notifier) NotifyBilling(ctx context.Context, key string, metadata KlMetadata, billing *ResourceBilling, stage stageTT) error

type Plan

type Plan string
const (
	ComputeBasic      Plan = "Plan"
	ComputeGeneral    Plan = "General"
	ComputeHighMemory Plan = "HighMemory"

	BlockStorageDefault Plan = "Default"
	LambdaDefault       Plan = "Default"
)

type ResourceBilling

type ResourceBilling struct {
	Name  string    `json:"name,omitempty"`
	Items []K8sItem `json:"items,omitempty"`
}

type WrappedName

type WrappedName struct {
	Name  string `json:"name"`
	Group string `json:"group"`
}

func (WrappedName) ParseGroup

func (w WrappedName) ParseGroup() (*schema.GroupVersionKind, error)

func (WrappedName) String

func (w WrappedName) String() (string, error)

Jump to

Keyboard shortcuts

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