package handshake

import (
	"time"

	"github.com/tidbcloud/aws-shared-provider/pkg/infra"
)

type contextKey string

func (k contextKey) String() string {
	return "handler context key " + string(k)
}

// Context keys.
var (
	connContextKey contextKey = "conn_context"
)

type ConnContext struct {
	token  string
	user   string
	connID uint64
	start  time.Time
	phase  string
	status string
	err    error

	clusterType infra.ClusterType

	clusterID string
	tenantID  string
	projectID string

	keyspaceID           string
	tidbPool             string
	ruMode               string
	zoneRedundantEnabled bool
	enableAuditLog       bool
	auditLogRedacted     bool
	servicePlan          string

	clientInBytes, clientOutBytes uint64
	lastTrafficRecord             time.Time

	/* connection attributes */
	clientName    string
	clientVersion string
	programName   string
	attributes    string
	clientAddr    string
	vpcEndpointID string

	/* other */
	loggerInitialized bool

	/* empty password */
	anomalous bool
}
