package watcher

import (
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

type EventType string

const (
	CreationEventType = "create"
	DeletionEventType = "delete"
)

type PodWatchEvent struct {
	Name      string          `json:"name"`
	Namespace string          `json:"namespace"`
	Type      EventType       `json:"eventType"`
	Timestamp int64           `json:"timestamp"`
	Cluster   *TidbClusterRef `json:"cluster"`
}

type TidbClusterRef struct {
	Existed   bool   `json:"existed"`
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
	TenantId  string `json:"tenantId"`
	ClusterId string `json:"clusterId"`
}

// Key is to describe the pod event key in the queue
type Key struct {
	MetaNamespaceKey string
	Pod              metav1.Object
	Type             EventType
	Timestamp        int64
}
