package constant

const CDCChangefeedIDPrefix = "cfd-"

// ChangfeedState represents the state of the CDC changefeed.
type ChangfeedState string

const (
	ChangfeedStateRunning       ChangfeedState = "running"
	ChangefeedStateFailed       ChangfeedState = "running_failed"
	ChangefeedStateCreating     ChangfeedState = "creating"
	ChangefeedStateScaling      ChangfeedState = "scaling"
	ChangefeedStatePaused       ChangfeedState = "paused"
	ChangefeedStateDeleting     ChangfeedState = "deleting"
	ChangefeedStateDeleted      ChangfeedState = "deleted"
	ChangefeedStateWarning      ChangfeedState = "warning"
	ChangefeedStateCreateFailed ChangfeedState = "create_failed"
)

type ChangefeedType string

// The value needs to be consistent with the kernel.
const (
	ChangefeedTypeKafka        ChangefeedType = "kafka"
	ChangefeedTypeMySQL        ChangefeedType = "mysql"
	ChangefeedTypeCloudStorage ChangefeedType = "cloud_storage"
)

type ChangefeedArch string

const (
	ChangefeedArchReplicationWorker ChangefeedArch = "replication_worker"
	ChangefeedArchTiCDCNewArch      ChangefeedArch = "ticdc_newarch"
)

type TiCDCChangefeedKernelStatus string

const (
	TiCDCChangefeedKernelStatusPending TiCDCChangefeedKernelStatus = "pending"
	TiCDCChangefeedKernelStatusActive  TiCDCChangefeedKernelStatus = "active"
	TiCDCChangefeedKernelStatusDeleted TiCDCChangefeedKernelStatus = "deleted"
)

type TableMode string

const (
	TableModeIgnoreNotSupportTable TableMode = "ignore_not_support_table"
	TableModeForceSync             TableMode = "force_sync"
)

type StartMode string

const (
	StartModeFromNow  StartMode = "from_now"
	StartModeFromTSO  StartMode = "from_tso"
	StartModeFromTime StartMode = "from_time"
)

type KafkaNetworkType string

const (
	KafkaNetworkTypePublic      KafkaNetworkType = "public"
	KafkaNetworkTypePrivateLink KafkaNetworkType = "private_link"
)

type KafkaVersion string

const (
	KafkaVersion2XX KafkaVersion = "2xx"
	KafkaVersion3XX KafkaVersion = "3xx"
)

type KafkaCompressionType string

// The value needs to be consistent with the kernel.（excepect none)
const (
	KafkaCompressionTypeNone   KafkaCompressionType = "none"
	KafkaCompressionTypeGZIP   KafkaCompressionType = "gzip"
	KafkaCompressionTypeSnappy KafkaCompressionType = "snappy"
	KafkaCompressionTypeLZ4    KafkaCompressionType = "lz4"
	KafkaCompressionTypeZSTD   KafkaCompressionType = "zstd"
)

type KafkaAuthType string

// The value needs to be consistent with the kernel.（excepect DISABLE）
const (
	KafkaAuthTypeDISABLE      KafkaAuthType = "DISABLE"
	KafkaAuthTypeSASLPlain    KafkaAuthType = "PLAIN"
	KafkaAuthTypeSASLScram256 KafkaAuthType = "SCRAM-SHA-256"
	KafkaAuthTypeSASLScram512 KafkaAuthType = "SCRAM-SHA-512"
)

type ClusterProxyKafkaAuthType string

const (
	ClusterProxyKafkaAuthTypePlain       ClusterProxyKafkaAuthType = "sasl-plain"
	ClusterProxyKafkaAuthTypeScramSha256 ClusterProxyKafkaAuthType = "sasl-scram-sha-256"
	ClusterProxyKafkaAuthTypeScramSha512 ClusterProxyKafkaAuthType = "sasl-scram-sha-512"
)

type CDCProtocol string

// The value needs to be consistent with the kernel.
const (
	CDCProtocolCanalJSON CDCProtocol = "canal-json"
	CDCProtocolOpen      CDCProtocol = "open-protocol"
	CDCProtocolAvro      CDCProtocol = "avro"
	CDCProtocolDebezium  CDCProtocol = "debezium"
)

type DecimalHandlingMode string

// The value needs to be consistent with the kernel.
const (
	DecimalHandlingModePrecise DecimalHandlingMode = "precise"
	DecimalHandlingModeString  DecimalHandlingMode = "string"
)

type BigintUnsignedHandlingMode string

// The value needs to be consistent with the kernel.
const (
	BigintUnsignedHandlingModeLong   BigintUnsignedHandlingMode = "long"
	BigintUnsignedHandlingModeString BigintUnsignedHandlingMode = "string"
)

type TopicDispatchType string

const (
	TopicDispatchTypeOneTopic   TopicDispatchType = "one_topic"
	TopicDispatchTypeByTable    TopicDispatchType = "by_table"
	TopicDispatchTypeByDatabase TopicDispatchType = "by_database"
)

type PartitionDispatcher string

// The value needs to be consistent with the kernel.
const (
	PartitionDispatcherTable      PartitionDispatcher = "table"
	PartitionDispatcherIndexValue PartitionDispatcher = "index-value"
	PartitionDispatcherTS         PartitionDispatcher = "ts"
	PartitionDispatcherColumns    PartitionDispatcher = "columns"
)

type CDCClusterState string

const (
	CDCClusterStateCreating CDCClusterState = "creating"
	CDCClusterStateRunning  CDCClusterState = "running"
	CDCClusterStateDeleted  CDCClusterState = "deleted"
)

type TiCDCClusterState string

const (
	TiCDCClusterStateCreating  TiCDCClusterState = "creating"
	TiCDCClusterStateRunning   TiCDCClusterState = "running"
	TiCDCClusterStateUpgrading TiCDCClusterState = "upgrading"
	TiCDCClusterStateDeleted   TiCDCClusterState = "deleted"
)

type MySQLNetworkType string

const (
	MySQLNetworkTypePublic      MySQLNetworkType = "public"
	MySQLNetworkTypePrivateLink MySQLNetworkType = "private_link"
)

type CloudStorageProtocol string

const (
	CloudStorageProtocolCanalJSON CloudStorageProtocol = "canal-json"
	CloudStorageProtocolCSV       CloudStorageProtocol = "csv"
)

type CloudStorageDateSeparator string

// The value needs to be consistent with the kernel.
const (
	DateSeparatorNone  CloudStorageDateSeparator = "none"
	DateSeparatorYear  CloudStorageDateSeparator = "year"
	DateSeparatorMonth CloudStorageDateSeparator = "month"
	DateSeparatorDay   CloudStorageDateSeparator = "day"
)

type CloudStorageBinaryEncoding string

const (
	CloudStorageBinaryEncodingBase64 CloudStorageBinaryEncoding = "base64"
	CloudStorageBinaryEncodingHex    CloudStorageBinaryEncoding = "hex"
)
