summary history files

backend/types/cluster.go
package types

import (
	corev1 "k8s.io/api/core/v1"
)

type ClustersResponse struct {
	Success bool      `json:"success"`
	Msg     string    `json:"msg"`
	Data    []Cluster `json:"data"`
}

type Cluster struct {
	ContextName string `json:"contextName"`
}

func NewClustersResponse() ClustersResponse {
	r := ClustersResponse{
		Success: false,
		Msg:     "",
		Data:    []Cluster{},
	}
	return r
}

type PodsResponse struct {
	Success bool         `json:"success"`
	Msg     string       `json:"msg"`
	Data    []corev1.Pod `json:"data"`
}

type PodResponse struct {
	Success bool       `json:"success"`
	Msg     string     `json:"msg"`
	Data    corev1.Pod `json:"data"`
}

type Response struct {
	Success bool   `json:"success"`
	Msg     string `json:"msg"`
	Data    string `json:"data"`
}

func NewResponse() Response {
	return Response{}
}

type DescribeResponse struct {
	Success bool   `json:"success"`
	Msg     string `json:"msg"`
	Data    string `json:"data"`
}

func NewDescribeResponse() DescribeResponse {
	return DescribeResponse{}
}

type DescribePodResponse struct {
	Success bool   `json:"success"`
	Msg     string `json:"msg"`
	Data    string `json:"data"`
}

func NewDescribePodResponse() DescribePodResponse {
	return DescribePodResponse{}
}

func NewPodsResponse() PodsResponse {
	r := PodsResponse{
		Success: false,
		Msg:     "",
		Data:    []corev1.Pod{},
	}
	return r
}

func NewPodResponse() PodResponse {
	r := PodResponse{
		Success: false,
		Msg:     "",
		Data:    corev1.Pod{},
	}
	return r
}