dtos

package
v1.3.0-develop.35 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func ExtractSingleConfigFromContext added in v1.3.3

func ExtractSingleConfigFromContext(config *api.Config, contextName string) (*api.Config, error)

func ListContextsToTerminal added in v1.2.38

func ListContextsToTerminal(contexts []PunqContext)

func ListUsers

func ListUsers(users []PunqUser)

func PrintAllContextFromConfig added in v1.3.3

func PrintAllContextFromConfig(config *api.Config)

func WriteSingleConfigFileFromContext added in v1.3.3

func WriteSingleConfigFileFromContext(config *api.Config, contextName string) error

Types

type AccessLevel

type AccessLevel int
const (
	READER AccessLevel = iota
	USER
	ADMIN
)

func AccessLevelFromString

func AccessLevelFromString(level string) AccessLevel

type ClusterInfoDto added in v1.2.15

type ClusterInfoDto struct {
	ClusterStatus ClusterStatusDto `json:"clusterStatus"`
	NodeStats     []NodeStat       `json:"nodeStats"`
}

type ClusterResourceInfoDto

type ClusterResourceInfoDto struct {
	LoadBalancerExternalIps []string   `json:"loadBalancerExternalIps"`
	NodeStats               []NodeStat `json:"nodeStats"`
}

type ClusterStatusDto

type ClusterStatusDto struct {
	ClusterName                  string `json:"clusterName"`
	Pods                         int    `json:"pods"`
	CpuInMilliCores              int    `json:"cpu"`
	CpuLimitInMilliCores         int    `json:"cpuLimit"`
	MemoryInBytes                int64  `json:"memoryInBytes"`
	MemoryLimitInBytes           int64  `json:"memoryLimitInBytes"`
	EphemeralStorageLimitInBytes int64  `json:"ephemeralStorageLimitInBytes"`
	CurrentTime                  string `json:"currentTime"`
	KubernetesVersion            string `json:"kubernetesVersion"`
	Platform                     string `json:"platform"`
}

func ClusterStatusDtoExmapleData

func ClusterStatusDtoExmapleData() ClusterStatusDto

type KubernetesProvider added in v1.3.2

type KubernetesProvider string
const (
	BRING_YOUR_OWN               KubernetesProvider = "BRING_YOUR_OWN"
	DOCKER_ENTERPRISE            KubernetesProvider = "DOCKER_ENTERPRISE"            // Docker
	DOCKER_DESKTOP               KubernetesProvider = "DOCKER_DESKTOP"               // Docker
	AKS                          KubernetesProvider = "AKS"                          // Azure Kubernetes Service
	GKE                          KubernetesProvider = "GKE"                          // Google Kubernetes Engine
	EKS                          KubernetesProvider = "EKS"                          // Amazon Elastic Kubernetes Service
	K3S                          KubernetesProvider = "K3S"                          // K3S
	K3D                          KubernetesProvider = "K3D"                          // K3D
	MINIKUBE                     KubernetesProvider = "MINIKUBE"                     // Minikube
	KIND                         KubernetesProvider = "KIND"                         // Kind
	KUBERNETES                   KubernetesProvider = "KUBERNETES"                   // Kubernetes
	SELF_HOSTED                  KubernetesProvider = "SELF_HOSTED"                  // Self Hosted
	DOKS                         KubernetesProvider = "DOKS"                         // Digital Ocean Kubernetes
	LINODE                       KubernetesProvider = "LINODE"                       // Linode Kubernetes
	IBM                          KubernetesProvider = "IBM"                          // IBM Kubernetes
	ACK                          KubernetesProvider = "ACK"                          // Alibaba Cloud Kubernetes
	OKE                          KubernetesProvider = "OKE"                          // Oracle Cloud Kubernetes
	OTC                          KubernetesProvider = "OTC"                          // Telekom cloud
	OPEN_SHIFT                   KubernetesProvider = "OPEN_SHIFT"                   // Telekom cloud
	GKE_ON_PREM                  KubernetesProvider = "GKE_ON_PREM"                  // Google Kubernetes Engine On-Prem
	RKE                          KubernetesProvider = "RKE"                          // Rancher Kubernetes Engine
	KUBEADM                      KubernetesProvider = "KUBEADM"                      // Kubeadm
	KUBEADM_ON_PREM              KubernetesProvider = "KUBEADM_ON_PREM"              // Kubeadm On-Prem
	KUBEADM_ON_PREM_HETZNER      KubernetesProvider = "KUBEADM_ON_PREM_HETZNER"      // Kubeadm On-Prem Hetzner
	KUBEADM_ON_PREM_DIGITALOCEAN KubernetesProvider = "KUBEADM_ON_PREM_DIGITALOCEAN" // Kubeadm On-Prem Digital Ocean
	KUBEADM_ON_PREM_LINODE       KubernetesProvider = "KUBEADM_ON_PREM_LINODE"       // Kubeadm On-Prem Linode
	KUBEADM_ON_PREM_AWS          KubernetesProvider = "KUBEADM_ON_PREM_AWS"          // Kubeadm On-Prem AWS
	KUBEADM_ON_PREM_AZURE        KubernetesProvider = "KUBEADM_ON_PREM_AZURE"        // Kubeadm On-Prem Azure
	KUBEADM_ON_PREM_GCP          KubernetesProvider = "KUBEADM_ON_PREM_GCP"          // Kubeadm On-Prem GCP
	SYS_ELEVEN                   KubernetesProvider = "SYS_ELEVEN"                   // Managed Kubernetes by SysEleven
	STACKIT                      KubernetesProvider = "SKE"                          // STACKIT Kubernetes Engine (SKE)
	IONOS                        KubernetesProvider = "IONOS"                        // IONOS Cloud Managed
	SCALEWAY                     KubernetesProvider = "SCALEWAY"                     // scaleway
)

type NodeStat

type NodeStat struct {
	Name             string `json:"name" validate:"required"`
	MaschineId       string `json:"maschineId" validate:"required"`
	Cpus             int64  `json:"cpus" validate:"required"`
	MemoryInBytes    int64  `json:"memoryInBytes" validate:"required"`
	EphemeralInBytes int64  `json:"ephemeralInBytes" validate:"required"`
	MaxPods          int64  `json:"maxPods" validate:"required"`
	KubletVersion    string `json:"kubletVersion" validate:"required"`
	OsType           string `json:"osType" validate:"required"`
	OsImage          string `json:"osImage" validate:"required"`
	Architecture     string `json:"architecture" validate:"required"`
}

func (*NodeStat) PrintPretty

func (o *NodeStat) PrintPretty()

type PunqAccess

type PunqAccess struct {
	UserId string      `json:"userId" validate:"required"`
	Level  AccessLevel `json:"level" validate:"required"`
}

type PunqContext

type PunqContext struct {
	Id          string       `json:"id" validate:"required"`
	Name        string       `json:"name" validate:"required"`
	ContextHash string       `json:"contextHash" validate:"required"`
	Context     string       `json:"context" validate:"required"`
	Provider    string       `json:"provider" validate:"required"`
	Access      []PunqAccess `json:"access" validate:"required"`
}

func CreateContext added in v1.2.38

func CreateContext(id string, name string, context string, provider string, access []PunqAccess) PunqContext

func ParseConfigToPunqContexts added in v1.3.3

func ParseConfigToPunqContexts(data []byte) ([]PunqContext, error)

func ParseCurrentContextConfigToPunqContext added in v1.3.3

func ParseCurrentContextConfigToPunqContext(data []byte) (PunqContext, error)

func (*PunqContext) AddAccess

func (c *PunqContext) AddAccess(userId string, accessLevel AccessLevel)

func (*PunqContext) PrintToTerminal added in v1.2.38

func (c *PunqContext) PrintToTerminal()

func (*PunqContext) RemoveAccess

func (c *PunqContext) RemoveAccess(userId string)

type PunqToken added in v1.2.0

type PunqToken struct {
	Token string `json:"token" validate:"required"`
}

func CreateToken added in v1.2.0

func CreateToken(token string) *PunqToken

type PunqUser

type PunqUser struct {
	Id          string      `json:"id" validate:"required"`
	Email       string      `json:"email" validate:"required"`
	Password    string      `json:"password" validate:"required"`
	DisplayName string      `json:"displayName" validate:"required"`
	AccessLevel AccessLevel `json:"accessLevel" validate:"required"`
	Created     string      `json:"createdAt" validate:"required"`
}

func (*PunqUser) PasswordCheck added in v1.2.0

func (user *PunqUser) PasswordCheck(password string) (bool, error)

type PunqUserCreateInput added in v1.2.0

type PunqUserCreateInput struct {
	Email       string      `json:"email" validate:"required"`
	Password    string      `json:"password" validate:"required"`
	DisplayName string      `json:"displayName" validate:"required"`
	AccessLevel AccessLevel `json:"accessLevel" validate:"required"`
}

Jump to

Keyboard shortcuts

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