types

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 23 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ConsumerGroupTypeClassic  = "classic"
	ConsumerGroupTypeConsumer = "consumer"
	ConsumerGroupTypeShare    = "share"
	ConsumerGroupTypeStreams  = "streams"
)
View Source
const (
	ServiceAWSCertificateManager = "AWS Certificate Manager"
	ServiceMSK                   = "Amazon Managed Streaming for Apache Kafka"
	ServiceEC2Other              = "EC2 - Other"
	ServiceELB                   = "Amazon Elastic Load Balancing"
	ServiceVPC                   = "Amazon Virtual Private Cloud"

	// ServiceMSKConnect is a synthetic label, not a real Cost Explorer SERVICE value.
	// MSK Connect bills under ServiceMSK with USAGE_TYPE "<region>-Kafka.mcu.general";
	// report.flattenCosts relabels those rows to this constant so Connect cost is
	// visible as its own category instead of hiding inside broker cost.
	ServiceMSKConnect = "Amazon Managed Streaming for Apache Kafka Connect"
)

AWS service name constants — single source of truth for Cost Explorer service filters. Frontend constants (cmd/ui/frontend/src/constants/index.ts AWS_SERVICES) should mirror these.

Variables

View Source
var AclMap = map[string]ACLMapping{
	"kafka-cluster:AlterCluster": {
		Operation:       "Alter",
		ResourceType:    "Cluster",
		RequiresPattern: false,
	},
	"kafka-cluster:AlterClusterDynamicConfiguration": {
		Operation:       "AlterConfigs",
		ResourceType:    "Cluster",
		RequiresPattern: false,
	},
	"kafka-cluster:AlterGroup": {
		Operation:       "Read",
		ResourceType:    "Group",
		RequiresPattern: true,
	},
	"kafka-cluster:AlterTopic": {
		Operation:       "Alter",
		ResourceType:    "Topic",
		RequiresPattern: true,
	},
	"kafka-cluster:AlterTopicDynamicConfiguration": {
		Operation:       "AlterConfigs",
		ResourceType:    "Topic",
		RequiresPattern: true,
	},
	"kafka-cluster:AlterTransactionalId": {
		Operation:       "Write",
		ResourceType:    "TransactionalId",
		RequiresPattern: true,
	},
	"kafka-cluster:CreateTopic": {
		Operation:       "Create",
		ResourceType:    "Topic",
		RequiresPattern: true,
	},
	"kafka-cluster:DeleteGroup": {
		Operation:       "Delete",
		ResourceType:    "Group",
		RequiresPattern: true,
	},
	"kafka-cluster:DeleteTopic": {
		Operation:       "Delete",
		ResourceType:    "Topic",
		RequiresPattern: true,
	},
	"kafka-cluster:DescribeCluster": {
		Operation:       "Describe",
		ResourceType:    "Cluster",
		RequiresPattern: false,
	},
	"kafka-cluster:DescribeClusterDynamicConfiguration": {
		Operation:       "DescribeConfigs",
		ResourceType:    "Cluster",
		RequiresPattern: false,
	},
	"kafka-cluster:DescribeGroup": {
		Operation:       "Describe",
		ResourceType:    "Group",
		RequiresPattern: true,
	},
	"kafka-cluster:DescribeTopic": {
		Operation:       "Describe",
		ResourceType:    "Topic",
		RequiresPattern: true,
	},
	"kafka-cluster:DescribeTopicDynamicConfiguration": {
		Operation:       "DescribeConfigs",
		ResourceType:    "Topic",
		RequiresPattern: true,
	},
	"kafka-cluster:DescribeTransactionalId": {
		Operation:       "Describe",
		ResourceType:    "TransactionalId",
		RequiresPattern: true,
	},
	"kafka-cluster:ReadData": {
		Operation:       "Read",
		ResourceType:    "Topic",
		RequiresPattern: true,
	},
	"kafka-cluster:WriteData": {
		Operation:       "Write",
		ResourceType:    "Topic",
		RequiresPattern: true,
	},
	"kafka-cluster:WriteDataIdempotently": {
		Operation:       "IdempotentWrite",
		ResourceType:    "Cluster",
		RequiresPattern: true,
	},
}

https://docs.aws.amazon.com/service-authorization/latest/reference/list_apachekafkaapisforamazonmskclusters.html https://docs.confluent.io/cloud/current/security/access-control/acl.html#acl-resources-and-operations-for-ccloud-summary

Functions

func AllAuthTypes

func AllAuthTypes() []string

AllAuthTypes returns all possible AuthType values as strings This can be called statically without needing an AuthType instance

func FormatQueryDuration added in v0.8.0

func FormatQueryDuration(d time.Duration) string

FormatQueryDuration formats a duration for display, using days when >= 24h. Examples: "5m", "2h30m", "7d2h", "30d".

func NormalizeSaslMechanism added in v0.8.0

func NormalizeSaslMechanism(mechanism string) string

NormalizeSaslMechanism converts shorthand mechanism values (e.g. "SHA256") to the Kafka-standard format (e.g. "SCRAM-SHA-256"). Returns empty string for empty input.

func ValidBrokerMetricLabels added in v0.9.0

func ValidBrokerMetricLabels() []string

ValidBrokerMetricLabels returns the canonical broker-metric labels, sorted for a stable error message and stable test assertions.

func ValidConnectMetricLabels added in v0.9.2

func ValidConnectMetricLabels() []string

ValidConnectMetricLabels returns the canonical Connect-metric labels, sorted for a stable error message and stable test assertions.

func ValidateMigrateClusterCredentials added in v0.9.0

func ValidateMigrateClusterCredentials(mc MigrateClusterCredentials) []error

ValidateMigrateClusterCredentials applies every migrate-credentials rule to an already-built struct, so a caller that assembled the block itself (an inline manifest block) is held to the same rules as a file.

Types

type ACLMapping added in v0.2.1

type ACLMapping struct {
	Operation       string
	ResourceType    string
	RequiresPattern bool
}

type AWSClientInformation added in v0.4.0

type AWSClientInformation struct {
	MskClusterConfig     kafkatypes.Cluster                     `json:"msk_cluster_config"`
	ClientVpcConnections []kafkatypes.ClientVpcConnection       `json:"client_vpc_connections"`
	ClusterOperations    []kafkatypes.ClusterOperationV2Summary `json:"cluster_operations"`
	Nodes                []kafkatypes.NodeInfo                  `json:"nodes"`
	ScramSecrets         []string                               `json:"ScramSecrets"`
	BootstrapBrokers     kafka.GetBootstrapBrokersOutput        `json:"bootstrap_brokers"`
	Policy               kafka.GetClusterPolicyOutput           `json:"policy"`
	CompatibleVersions   kafka.GetCompatibleKafkaVersionsOutput `json:"compatible_versions"`
	ClusterNetworking    ClusterNetworking                      `json:"cluster_networking"`
	Connectors           []ConnectorSummary                     `json:"connectors"`
	ConnectorMetrics     *ConnectClusterMetrics                 `json:"connector_metrics,omitempty"`
}

func (*AWSClientInformation) GetAllBootstrapBrokersForAuthType added in v0.4.0

func (c *AWSClientInformation) GetAllBootstrapBrokersForAuthType(authType AuthType) ([]string, error)

Returns all bootstrap brokers for a given auth type.

func (*AWSClientInformation) GetBootstrapBrokersForAuthType added in v0.4.0

func (c *AWSClientInformation) GetBootstrapBrokersForAuthType(authType AuthType) ([]string, error)

Returns only one bootstrap broker per authentication type.

type Acls added in v0.2.1

type Acls struct {
	ResourceType        string `json:"ResourceType"`
	ResourceName        string `json:"ResourceName"`
	ResourcePatternType string `json:"ResourcePatternType"`
	Principal           string `json:"Principal"`
	Host                string `json:"Host"`
	Operation           string `json:"Operation"`
	PermissionType      string `json:"PermissionType"`
}

Preferred over sarama.ResourceAcls because it is flattened vs sarama's nested structure.

type AuthMethodConfig added in v0.2.7

type AuthMethodConfig struct {
	IAM                      *IAMConfig                      `yaml:"iam,omitempty"`
	SASLScram                *SASLScramConfig                `yaml:"sasl_scram,omitempty"`
	SASLPlain                *SASLPlainConfig                `yaml:"sasl_plain,omitempty"`
	TLS                      *TLSConfig                      `yaml:"tls,omitempty"`
	UnauthenticatedTLS       *UnauthenticatedTLSConfig       `yaml:"unauthenticated_tls,omitempty"`
	UnauthenticatedPlaintext *UnauthenticatedPlaintextConfig `yaml:"unauthenticated_plaintext,omitempty"`
}

func (AuthMethodConfig) EnabledAuthMethods added in v0.8.6

func (amc AuthMethodConfig) EnabledAuthMethods(includeIAM bool) []AuthType

EnabledAuthMethods returns the enabled methods in canonical order. includeIAM is false for sources that don't support IAM (Apache Kafka / OSK).

func (*AuthMethodConfig) MergeWith added in v0.4.0

func (amc *AuthMethodConfig) MergeWith(existing AuthMethodConfig)

MergeWith preserves existing auth configurations only for auth methods that still exist in the new config

func (AuthMethodConfig) SelectedAuthType added in v0.8.6

func (amc AuthMethodConfig) SelectedAuthType(includeIAM bool) (AuthType, error)

SelectedAuthType returns the single enabled method, or an error if none.

type AuthType

type AuthType string

AuthType represents the different authentication types supported by MSK clusters

const (
	AuthTypeSASLSCRAM                AuthType = "SASL/SCRAM"
	AuthTypeIAM                      AuthType = "SASL/IAM"
	AuthTypeTLS                      AuthType = "TLS"
	AuthTypeUnauthenticatedPlaintext AuthType = "Unauthenticated (Plaintext)"
	AuthTypeUnauthenticatedTLS       AuthType = "Unauthenticated (TLS Encryption)"
	AuthTypeSASLPlain                AuthType = "SASL/PLAIN"
)

func (AuthType) IsValid

func (a AuthType) IsValid() bool

func (AuthType) Values

func (a AuthType) Values() []string

Values returns all possible AuthType values as strings

type BrokerType added in v0.6.4

type BrokerType string

----- metrics -----

const (
	BrokerTypeExpress  BrokerType = "express"
	BrokerTypeStandard BrokerType = "standard"
)

type CloudWatchTimeWindow added in v0.4.0

type CloudWatchTimeWindow struct {
	StartTime time.Time
	EndTime   time.Time
	Period    int32
}

type ClusterAuth added in v0.4.0

type ClusterAuth struct {
	Name       string           `yaml:"name"`
	Arn        string           `yaml:"arn"`
	AuthMethod AuthMethodConfig `yaml:"auth_method"`
}

func (ClusterAuth) GetAuthMethods added in v0.4.0

func (ce ClusterAuth) GetAuthMethods() []AuthType

Gets a list of the authentication method(s) selected in the `creds.yaml` file generated during discovery.

func (ClusterAuth) GetSelectedAuthType added in v0.4.0

func (ce ClusterAuth) GetSelectedAuthType() (AuthType, error)

type ClusterMetrics

type ClusterMetrics struct {
	MetricMetadata MetricMetadata                     `json:"metadata"`
	Results        []cloudwatchtypes.MetricDataResult `json:"results"`
	QueryInfo      []MetricQueryInfo                  `json:"query_info"`
}

type ClusterNetworking added in v0.2.2

type ClusterNetworking struct {
	VpcId          string       `json:"vpc_id"`
	SubnetIds      []string     `json:"subnet_ids"`
	SecurityGroups []string     `json:"security_groups"`
	Subnets        []SubnetInfo `json:"subnets"`
}

type ConnectAuthMethod added in v0.4.2

type ConnectAuthMethod string

ConnectAuthMethod identifies how kcp authenticates to a self-managed Kafka Connect cluster's REST API.

const (
	ConnectAuthMethodBasicAuth       ConnectAuthMethod = "BasicAuth"
	ConnectAuthMethodTls             ConnectAuthMethod = "TLS"
	ConnectAuthMethodUnauthenticated ConnectAuthMethod = "Unauthenticated"
)

type ConnectBasicAuth added in v0.8.12

type ConnectBasicAuth struct {
	Username string
	Password string
}

ConnectBasicAuth holds HTTP Basic credentials for a Basic-auth-protected Connect REST endpoint.

type ConnectCluster added in v0.8.12

type ConnectCluster struct {
	ConnectRestURL string                 `json:"connect_rest_url"`
	Metrics        *ConnectClusterMetrics `json:"metrics,omitempty"`
	Connectors     []Connector            `json:"connectors"`
}

ConnectCluster groups the connectors discovered from one Connect REST endpoint (the scan's --connect-rest-url), the stable identity of "which Connect cluster". Metrics holds the cluster-level (worker/client) metrics for this endpoint.

type ConnectClusterMetrics added in v0.8.6

type ConnectClusterMetrics struct {
	Metadata   ConnectMetricMetadata      `json:"metadata"`
	Metrics    []ProcessedMetric          `json:"results"`
	Aggregates map[string]MetricAggregate `json:"aggregates"`
	QueryInfo  []MetricQueryInfo          `json:"query_info"`
}

ConnectClusterMetrics is the purpose-built metrics envelope for self-managed Kafka Connect. It mirrors the consumable parts of ProcessedClusterMetrics (results, aggregates, query_info) but drops the broker-only metadata and the region/cluster_arn that are meaningless for a Connect cluster.

type ConnectMetricMetadata added in v0.8.6

type ConnectMetricMetadata struct {
	StartDate     time.Time     `json:"start_date"`
	EndDate       time.Time     `json:"end_date"`
	Period        int32         `json:"period"`
	MetricsSource MetricBackend `json:"metrics_source"`
}

ConnectMetricMetadata describes a self-managed Kafka Connect metrics collection. Unlike the broker-oriented MetricMetadata, it carries only fields meaningful in the Connect scope: the collection window, the polling granularity, and which backend produced the data. MetricsSource reuses the shared MetricBackend type (jolokia or prometheus for self-managed, cloudwatch for MSK-managed) so it stays consistent with QueryInfo.SourceType and the collector dispatch; the JSON wire value is unchanged. metrics_source is intentionally NOT omitempty — it belongs to every Connect metrics block; legacy state files (collected before this field existed) load with it empty.

type ConnectTlsAuth added in v0.4.2

type ConnectTlsAuth struct {
	CACert             string
	ClientCert         string
	ClientKey          string
	InsecureSkipVerify bool
}

ConnectTlsAuth holds the TLS transport options for reaching a Connect REST endpoint over HTTPS. CACert (verify the server against a private/internal CA) and InsecureSkipVerify apply to ANY auth method; ClientCert/ClientKey are the client identity for mTLS (--use-tls).

type Connector added in v0.8.12

type Connector struct {
	Name   string         `json:"name"`
	State  string         `json:"state,omitempty"`
	Config map[string]any `json:"config"`
	// ConnectHost is the worker (worker_id from the Connect /status API) currently
	// running this connector. Informational only — NOT a grouping/merge key, since
	// it can change on rebalance and differs per worker in a distributed cluster.
	ConnectHost string                 `json:"connect_host,omitempty"`
	Metrics     *ConnectClusterMetrics `json:"metrics,omitempty"`
}

Connector is a single self-managed Kafka Connect connector discovered from a Connect REST endpoint. Metrics holds this connector's own source/sink-task rates once per-connector collection runs (Plan 2); it is nil until then.

type ConnectorSummary added in v0.4.0

type ConnectorSummary struct {
	ConnectorArn                     string                                                        `json:"connector_arn"`
	ConnectorName                    string                                                        `json:"connector_name"`
	ConnectorState                   string                                                        `json:"connector_state"`
	CreationTime                     string                                                        `json:"creation_time"`
	KafkaCluster                     kafkaconnecttypes.ApacheKafkaClusterDescription               `json:"kafka_cluster"`
	KafkaClusterClientAuthentication kafkaconnecttypes.KafkaClusterClientAuthenticationDescription `json:"kafka_cluster_client_authentication"`
	Capacity                         kafkaconnecttypes.CapacityDescription                         `json:"capacity"`
	Plugins                          []kafkaconnecttypes.PluginDescription                         `json:"plugins"`
	ConnectorConfiguration           map[string]string                                             `json:"connector_configuration"`
}

func MergeConnectors added in v0.8.12

func MergeConnectors(newConns, oldConns []ConnectorSummary) []ConnectorSummary

MergeConnectors merges MSK connectors, with new taking precedence for duplicates (by ConnectorName). A nil/empty new set preserves the old set (so a denied/empty re-run does not wipe prior connectors), and a nil/empty old set yields the new set.

type ConsumerGroupDetails added in v0.9.1

type ConsumerGroupDetails struct {
	GroupID        string                `json:"group_id"`
	Type           string                `json:"type"` // classic/consumer/share/streams, or "" if unavailable
	State          string                `json:"state"`
	ProtocolType   string                `json:"protocol_type"`
	Coordinator    string                `json:"coordinator,omitempty"`
	Members        []ConsumerGroupMember `json:"members"`
	Topics         []string              `json:"topics"`
	DetailComplete bool                  `json:"detail_complete"` // false when the type has no type-specific describer yet (consumer/share/streams); see design §14.5
}

type ConsumerGroupListing added in v0.9.1

type ConsumerGroupListing struct {
	GroupID string
	Type    string
	State   string
}

ConsumerGroupListing is the type-aware ListGroups result (id + KIP-848 type + state). Internal intermediate, NOT part of the serialized State shape.

type ConsumerGroupMember added in v0.9.1

type ConsumerGroupMember struct {
	MemberID        string   `json:"member_id"`
	ClientID        string   `json:"client_id"`
	ClientHost      string   `json:"client_host"`
	GroupInstanceID string   `json:"group_instance_id,omitempty"`
	AssignedTopics  []string `json:"assigned_topics"`
}

type ConsumerGroupSummary added in v0.9.1

type ConsumerGroupSummary struct {
	Total   int            `json:"total"`
	ByType  map[string]int `json:"by_type"` // "" counts groups whose type the broker could not report
	ByState map[string]int `json:"by_state"`
}

func CalculateConsumerGroupSummary added in v0.9.1

func CalculateConsumerGroupSummary(details []ConsumerGroupDetails) ConsumerGroupSummary

CalculateConsumerGroupSummary mirrors CalculateTopicSummaryFromDetails.

type ConsumerGroups added in v0.9.1

type ConsumerGroups struct {
	Summary ConsumerGroupSummary   `json:"summary"`
	Details []ConsumerGroupDetails `json:"details"`
}

type CostInformation added in v0.4.0

type CostInformation struct {
	CostMetadata CostMetadata                     `json:"metadata"`
	CostResults  []costexplorertypes.ResultByTime `json:"results"`
	QueryInfo    CostQueryInfo                    `json:"query_info"`
}

type CostMetadata added in v0.4.0

type CostMetadata struct {
	StartDate   time.Time           `json:"start_date"`
	EndDate     time.Time           `json:"end_date"`
	Granularity string              `json:"granularity"`
	Tags        map[string][]string `json:"tags"`
	Services    []string            `json:"services"`
}

type CostQueryInfo added in v0.6.9

type CostQueryInfo struct {
	TimePeriod      CostQueryTimePeriod `json:"time_period"`
	Granularity     string              `json:"granularity"`
	Services        []string            `json:"services"`
	Regions         []string            `json:"regions"`
	GroupBy         []string            `json:"group_by"`
	Metrics         []string            `json:"metrics"`
	Tags            map[string][]string `json:"tags,omitempty"`
	AWSCLICommand   string              `json:"aws_cli_command"`
	ConsoleURL      string              `json:"console_url"`
	AggregationNote string              `json:"aggregation_note"`
}

type CostQueryTimePeriod added in v0.6.9

type CostQueryTimePeriod struct {
	Start string `json:"start"`
	End   string `json:"end"`
}

----- costs -----

type Credentials added in v0.2.7

type Credentials struct {
	Regions []RegionAuth `yaml:"regions"`
}

func NewCredentialsFrom added in v0.4.0

func NewCredentialsFrom(fromCredentials *Credentials) *Credentials

func NewCredentialsFromFile added in v0.4.0

func NewCredentialsFromFile(credentialsYamlPath string) (*Credentials, []error)

func (*Credentials) FindClusterByArn added in v0.7.0

func (c *Credentials) FindClusterByArn(arn string) (*ClusterAuth, error)

FindClusterByArn searches all regions for a cluster matching the given ARN.

func (*Credentials) ToYaml added in v0.2.7

func (c *Credentials) ToYaml() ([]byte, error)

func (*Credentials) UpsertRegion added in v0.4.0

func (c *Credentials) UpsertRegion(newRegion RegionAuth)

UpsertRegion inserts a new region or updates an existing one by name Automatically preserves existing cluster auth configurations

func (*Credentials) UpsertTargetedClusters added in v0.8.6

func (c *Credentials) UpsertTargetedClusters(newRegion RegionAuth)

UpsertTargetedClusters creates or replaces only the clusters present in newRegion.Clusters, preserving the auth config of every other cluster in the region. If the region does not exist it is added as-is. Mirrors State.UpsertTargetedClusters for the credentials file.

func (Credentials) Validate added in v0.2.7

func (c Credentials) Validate() (bool, []error)

func (*Credentials) WriteToFile added in v0.2.7

func (c *Credentials) WriteToFile(filePath string) error

type DestinationType added in v0.8.4

type DestinationType string

DestinationType identifies which Confluent Cloud variant a migration targets. It gates linking-based `kcp iac` paths that are unavailable on Confluent Cloud for Government (Cluster Linking, Schema Linking).

const (
	// DestinationCommercial is commercial (Standard) Confluent Cloud.
	DestinationCommercial DestinationType = "commercial"
	// DestinationGovernment is Confluent Cloud for Government.
	DestinationGovernment DestinationType = "government"
)

func ToDestinationType added in v0.8.4

func ToDestinationType(input string) (DestinationType, error)

ToDestinationType parses a CLI/declaration value into a DestinationType. Matching is case-insensitive — the input is lowercased before validation and the returned value is the canonical lowercase form. Surrounding whitespace is not trimmed, so padded values are rejected. An empty or unrecognised value returns an error naming the allowed values so callers can surface it directly.

func (DestinationType) IsGov added in v0.8.4

func (d DestinationType) IsGov() bool

IsGov reports whether the destination is Confluent Cloud for Government.

func (DestinationType) IsValid added in v0.8.4

func (d DestinationType) IsValid() bool

type DiscoveredClient added in v0.5.2

type DiscoveredClient struct {
	CompositeKey string    `json:"composite_key"`
	ClientId     string    `json:"client_id"`
	Role         string    `json:"role"`
	Topic        string    `json:"topic"`
	Auth         string    `json:"auth"`
	Principal    string    `json:"principal"`
	Timestamp    time.Time `json:"timestamp"`
}

type DiscoveredCluster added in v0.4.0

type DiscoveredCluster struct {
	Name                        string                      `json:"name"`
	Arn                         string                      `json:"arn"`
	Region                      string                      `json:"region"`
	ClusterMetrics              ClusterMetrics              `json:"metrics"`
	AWSClientInformation        AWSClientInformation        `json:"aws_client_information"`
	KafkaAdminClientInformation KafkaAdminClientInformation `json:"kafka_admin_client_information"`
	DiscoveredClients           []DiscoveredClient          `json:"discovered_clients"`
}

type DiscoveredRegion added in v0.4.0

type DiscoveredRegion struct {
	Name           string                                      `json:"name"`
	Configurations []kafka.DescribeConfigurationRevisionOutput `json:"configurations"`
	Costs          CostInformation                             `json:"costs"`
	Clusters       []DiscoveredCluster                         `json:"clusters"`
	// internal only - exclude from JSON output
	ClusterArns []string `json:"-"`
}

func (*DiscoveredRegion) RefreshClusters added in v0.4.0

func (dr *DiscoveredRegion) RefreshClusters(newClusters []DiscoveredCluster)

RefreshClusters replaces the cluster list but merges KafkaAdminClientInformation from existing clusters New discoveries take precedence over old values (only uses old values when new values are empty/nil)

func (*DiscoveredRegion) UpsertCluster added in v0.8.6

func (dr *DiscoveredRegion) UpsertCluster(newCluster DiscoveredCluster)

UpsertCluster creates or replaces a single cluster by ARN, preserving every other cluster in the region and merging the targeted cluster's scan-acquired admin info.

type GlueSchema added in v0.7.2

type GlueSchema struct {
	SchemaName string              `json:"schema_name"`
	SchemaArn  string              `json:"schema_arn"`
	DataFormat string              `json:"data_format"`
	Versions   []GlueSchemaVersion `json:"versions"`
	Latest     *GlueSchemaVersion  `json:"latest_version"`
}

type GlueSchemaRegistryInformation added in v0.7.2

type GlueSchemaRegistryInformation struct {
	RegistryName string       `json:"registry_name"`
	RegistryArn  string       `json:"registry_arn"`
	Region       string       `json:"region"`
	Schemas      []GlueSchema `json:"schemas"`
}

type GlueSchemaVersion added in v0.7.2

type GlueSchemaVersion struct {
	SchemaDefinition string    `json:"schema_definition"`
	DataFormat       string    `json:"data_format"`
	VersionNumber    int64     `json:"version_number"`
	Status           string    `json:"status"`
	CreatedDate      time.Time `json:"created_date"`
}

type IAMConfig added in v0.2.7

type IAMConfig struct {
	Use bool `yaml:"use"`
	// Region is the AWS region used for MSK IAM SigV4 token signing. Populated by
	// the migrate credentials path (iam.region); the scan path sources region
	// elsewhere and leaves this empty.
	Region string `yaml:"region,omitempty"`
}

type JolokiaAuthConfig added in v0.8.0

type JolokiaAuthConfig struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

JolokiaAuthConfig contains authentication credentials for Jolokia

type JolokiaConfig added in v0.8.0

type JolokiaConfig struct {
	Endpoints []string           `yaml:"endpoints"`
	Auth      *JolokiaAuthConfig `yaml:"auth,omitempty"`
	TLS       *JolokiaTLSConfig  `yaml:"tls,omitempty"`
	// MBeanOverrides maps a logical broker-metric label (e.g. "BytesInPerSec")
	// to the MBean object name this cluster's JMX/Jolokia agent actually exposes,
	// for agents that use non-standard MBean names. Keys must be one of the
	// labels in ValidBrokerMetricLabels(); unknown keys are rejected at load time.
	MBeanOverrides map[string]string `yaml:"mbean_overrides,omitempty"`
	// ConnectMBeanOverrides maps a logical Connect-metric label (e.g. "task-count")
	// to the MBean object name this cluster's JMX/Jolokia agent actually exposes.
	// Per-connector overrides must keep their connector=*,task=* wildcards. Keys
	// must be one of ValidConnectMetricLabels(); unknown keys are rejected at load time.
	ConnectMBeanOverrides map[string]string `yaml:"connect_mbean_overrides,omitempty"`
}

JolokiaConfig contains Jolokia monitoring configuration for a cluster

type JolokiaTLSConfig added in v0.8.0

type JolokiaTLSConfig struct {
	CACert             string `yaml:"ca_cert,omitempty"`
	InsecureSkipVerify bool   `yaml:"insecure_skip_verify,omitempty"`
}

JolokiaTLSConfig contains TLS configuration for Jolokia connections

type KafkaAdminClientInformation added in v0.4.0

type KafkaAdminClientInformation struct {
	ClusterID         string           `json:"cluster_id"`
	DiscoveredBrokers []string         `json:"discovered_brokers,omitempty"`
	SaslMechanism     string           `json:"sasl_mechanism,omitempty"`
	Topics            *Topics          `json:"topics"`
	Acls              []Acls           `json:"acls"`
	ConnectClusters   []ConnectCluster `json:"connect_clusters,omitempty"`
	ConsumerGroups    *ConsumerGroups  `json:"consumer_groups,omitempty"`
}

func (*KafkaAdminClientInformation) CalculateTopicSummary added in v0.4.0

func (c *KafkaAdminClientInformation) CalculateTopicSummary() TopicSummary

func (*KafkaAdminClientInformation) MergeFrom added in v0.6.0

MergeFrom merges values from another KafkaAdminClientInformation New discoveries are added, old data is preserved, duplicates are merged (new takes precedence)

func (*KafkaAdminClientInformation) SetConnectCluster added in v0.8.12

func (c *KafkaAdminClientInformation) SetConnectCluster(connectRestURL string, connectors []Connector)

SetConnectCluster finds-or-creates the ConnectCluster for connectRestURL and replaces its Connectors (a scan returns the complete listing for one endpoint), preserving that entry's own Metrics.

func (*KafkaAdminClientInformation) SetConnectClusterMetrics added in v0.8.12

func (c *KafkaAdminClientInformation) SetConnectClusterMetrics(connectRestURL string, metrics *ConnectClusterMetrics)

SetConnectClusterMetrics finds-or-creates the ConnectCluster for connectRestURL and sets its cluster-level Metrics, leaving Connectors untouched.

func (*KafkaAdminClientInformation) SetConsumerGroups added in v0.9.1

func (c *KafkaAdminClientInformation) SetConsumerGroups(groups *ConsumerGroups)

SetConsumerGroups sets ConsumerGroups from groups, recomputing Summary from Details so it always reflects the stored details (mirrors SetTopics). A nil groups clears ConsumerGroups back to "not scanned".

func (*KafkaAdminClientInformation) SetTopics added in v0.4.0

func (c *KafkaAdminClientInformation) SetTopics(topicDetails []TopicDetails)

type KafkaSourceConn added in v0.8.12

type KafkaSourceConn struct {
	BootstrapServers      []string
	AuthMethod            AuthMethodConfig
	InsecureSkipTLSVerify bool
}

KafkaSourceConn is the neutral, migrate-facing Kafka connection: a bootstrap address plus the single selected auth method (and IAM region, carried on AuthMethod.IAM.Region). It replaces the migrate path's prior reuse of the scan type OSKClusterAuth, which is correctly named only on the scan side.

func MigrateConn added in v0.8.12

func MigrateConn(bootstrapServers []string, creds MigrateClusterCredentials) KafkaSourceConn

MigrateConn combines a manifest bootstrap address with auth-only creds into the neutral KafkaSourceConn consumed by the migrate source reader and link-auth mapper.

func (KafkaSourceConn) GetAuthMethods added in v0.8.12

func (c KafkaSourceConn) GetAuthMethods() []AuthType

IAM is included (includeIAM=true): a migrate source may be MSK, which carries IAM on AuthMethod.IAM (region on AuthMethod.IAM.Region).

func (KafkaSourceConn) GetSelectedAuthType added in v0.8.12

func (c KafkaSourceConn) GetSelectedAuthType() (AuthType, error)

type KcpBuildInfo added in v0.3.1

type KcpBuildInfo struct {
	Version string `json:"version"`
	Commit  string `json:"commit"`
	Date    string `json:"date"`
}

type MSKSourcesState added in v0.8.0

type MSKSourcesState struct {
	Regions []DiscoveredRegion `json:"regions"`
}

MSKSourcesState contains all MSK-specific data

type Manifest

type Manifest struct {
	MigrationInfraType MigrationType `json:"migration_infra_type"`
}

type MetricAggregate added in v0.4.0

type MetricAggregate struct {
	Average *float64 `json:"avg"`
	Maximum *float64 `json:"max"`
	Minimum *float64 `json:"min"`
	P95     *float64 `json:"p95"`
	P99     *float64 `json:"p99"`
	// Count is the sample size of the aggregate. With `omitempty`,
	// "unknown" and "exactly 0 samples" both render as absent — treat
	// absence as "no sample data".
	Count int `json:"count,omitempty"`
}

type MetricBackend added in v0.8.0

type MetricBackend string

MetricBackend represents the metrics collection backend

const (
	MetricBackendCloudWatch MetricBackend = "cloudwatch"
	MetricBackendJolokia    MetricBackend = "jolokia"
	MetricBackendPrometheus MetricBackend = "prometheus"
)

type MetricMetadata added in v0.4.0

type MetricMetadata struct {
	ClusterType          string    `json:"cluster_type"`
	NumberOfBrokerNodes  int       `json:"number_of_broker_nodes"`
	KafkaVersion         string    `json:"kafka_version"`
	BrokerAzDistribution string    `json:"broker_az_distribution"`
	EnhancedMonitoring   string    `json:"enhanced_monitoring"`
	StartDate            time.Time `json:"start_date"`
	EndDate              time.Time `json:"end_date"`
	Period               int32     `json:"period"`

	FollowerFetching bool       `json:"follower_fetching"`
	InstanceType     string     `json:"instance_type"`
	TieredStorage    bool       `json:"tiered_storage"`
	BrokerType       BrokerType `json:"broker_type"`
}

type MetricQueryInfo added in v0.6.9

type MetricQueryInfo struct {
	MetricName string        `json:"metric_name"`
	SourceType MetricBackend `json:"source_type,omitempty"`

	// CloudWatch fields
	Namespace         string `json:"namespace,omitempty"`
	Dimensions        string `json:"dimensions,omitempty"`
	Statistic         string `json:"statistic,omitempty"`
	Period            int32  `json:"period,omitempty"`
	SearchExpression  string `json:"search_expression,omitempty"`
	MathExpression    string `json:"math_expression,omitempty"`
	AWSCLICommand     string `json:"aws_cli_command,omitempty"`
	ConsoleSourceJSON string `json:"console_source_json,omitempty"`

	// Jolokia fields
	MBeanPath  string `json:"mbean_path,omitempty"`
	JolokiaURL string `json:"jolokia_url,omitempty"`

	// Prometheus fields
	PromQLQuery          string `json:"promql_query,omitempty"`
	PrometheusURL        string `json:"prometheus_url,omitempty"`
	PrometheusMetricName string `json:"prometheus_metric_name,omitempty"`

	// Shared fields
	CurlCommand     string            `json:"curl_command,omitempty"` // Jolokia curl or Prometheus API curl
	QueryDuration   string            `json:"query_duration,omitempty"`
	AggregationNote string            `json:"aggregation_note"`
	LabelFilter     map[string]string `json:"label_filter,omitempty"`
}

type MigrateClusterCredentials added in v0.8.12

type MigrateClusterCredentials struct {
	IAM                      *MigrateIAM                      `yaml:"iam,omitempty" json:"iam,omitempty"`
	SASLScram                *MigrateSASLScram                `yaml:"sasl_scram,omitempty" json:"sasl_scram,omitempty"`
	SASLPlain                *MigrateSASLPlain                `yaml:"sasl_plain,omitempty" json:"sasl_plain,omitempty"`
	MTLS                     *MigrateMTLS                     `yaml:"mtls,omitempty" json:"mtls,omitempty"`
	UnauthenticatedTLS       *MigrateUnauthenticatedTLS       `yaml:"unauthenticated_tls,omitempty" json:"unauthenticated_tls,omitempty"`
	UnauthenticatedPlaintext *MigrateUnauthenticatedPlaintext `yaml:"unauthenticated_plaintext,omitempty" json:"unauthenticated_plaintext,omitempty"`
	InsecureSkipTLSVerify    bool                             `yaml:"insecure_skip_tls_verify,omitempty" json:"insecure_skip_tls_verify,omitempty"`
}

MigrateClusterCredentials is the flat, single-cluster, auth-only Kafka credentials format used by `kcp migration resources` (spec.source.credentials, spec.clusterLink.source.credentials, spec.clusterLink.destination.credentials). Unlike the OSK scan format it has no clusters: list, no id, no bootstrap_servers, and no scan-only jolokia/prometheus/metadata blocks — bootstrap addresses come from the manifest, and this file holds auth only.

Exactly one auth method block must be present. Auth is selected by PRESENCE (no use: flag, no auth_method: wrapper). Example:

sasl_scram: { username: admin, password: secret, mechanism: SHA256 }

or for plaintext:

unauthenticated_plaintext: {}

func LoadMigrateClusterCredentials added in v0.8.12

func LoadMigrateClusterCredentials(path string) (MigrateClusterCredentials, []error)

LoadMigrateClusterCredentials reads, parses and validates the auth-only flat migrate credentials file, returning the auth-only MigrateClusterCredentials. The bootstrap address comes from the manifest (see MigrateConn). Returns all problems.

func ParseMigrateClusterCredentials added in v0.9.0

func ParseMigrateClusterCredentials(data []byte) (MigrateClusterCredentials, []error)

ParseMigrateClusterCredentials parses and validates migrate credentials from bytes. It is the shared entry point so an inline manifest block and a referenced file run exactly the same validation.

func UnmarshalMigrateClusterCredentials added in v0.9.0

func UnmarshalMigrateClusterCredentials(data []byte) (MigrateClusterCredentials, error)

UnmarshalMigrateClusterCredentials parses and resolves credentials WITHOUT validating them. It exists so a caller that must fill a default before the rules run — kcp migration defaults an omitted sasl_scram.mechanism to SHA512, matching the flag it replaces — can do so without duplicating the parse.

type MigrateIAM added in v0.8.12

type MigrateIAM struct {
	Region string `yaml:"region" json:"region"`
}

MigrateIAM is the MSK IAM auth block. region is required (SigV4 token signing); there is no auto-derive. Valid only for an MSK source's read credentials.

type MigrateMTLS added in v0.8.12

type MigrateMTLS struct {
	CACert     string `yaml:"ca_cert,omitempty" json:"ca_cert,omitempty"`
	ClientCert string `yaml:"client_cert" json:"client_cert"`
	ClientKey  string `yaml:"client_key" json:"client_key"`
}

MigrateMTLS is the mutual-TLS auth block for migrate credentials (client cert + key; no use: flag). The client authenticates with a certificate — distinct from unauthenticated_tls (one-way TLS: server cert only, client not authenticated).

type MigrateSASLPlain added in v0.8.12

type MigrateSASLPlain struct {
	Username string `yaml:"username" json:"username"`
	Password string `yaml:"password" json:"password"`
	CACert   string `yaml:"ca_cert,omitempty" json:"ca_cert,omitempty"`
	UseTLS   bool   `yaml:"tls,omitempty" json:"tls,omitempty"`
}

MigrateSASLPlain is the SASL/PLAIN auth block for migrate credentials (no use: flag). Transport: ca_cert present ⇒ SASL_SSL (trusting that CA); tls: true ⇒ SASL_SSL over the system/public trust store (no custom CA); neither ⇒ SASL_PLAINTEXT.

type MigrateSASLScram added in v0.8.12

type MigrateSASLScram struct {
	Username  string `yaml:"username" json:"username"`
	Password  string `yaml:"password" json:"password"`
	Mechanism string `yaml:"mechanism,omitempty" json:"mechanism,omitempty"` // "SHA256" or "SHA512"
	CACert    string `yaml:"ca_cert,omitempty" json:"ca_cert,omitempty"`
}

MigrateSASLScram is the SASL/SCRAM auth block for migrate credentials (no use: flag).

type MigrateUnauthenticatedPlaintext added in v0.8.12

type MigrateUnauthenticatedPlaintext struct{}

MigrateUnauthenticatedPlaintext is an empty marker block — its PRESENCE (unauthenticated_plaintext: {}) selects plaintext. goccy/go-yaml unmarshals `{}` into a non-nil pointer for an empty struct, while a missing key or null yields nil.

type MigrateUnauthenticatedTLS added in v0.8.12

type MigrateUnauthenticatedTLS struct {
	CACert string `yaml:"ca_cert,omitempty" json:"ca_cert,omitempty"`
}

MigrateUnauthenticatedTLS is the unauthenticated TLS auth block for migrate credentials (no use: flag).

type MigrationType added in v0.5.0

type MigrationType int
const (
	PublicMskEndpoints                   MigrationType = 1
	ExternalOutboundClusterLink          MigrationType = 2
	ExternalOutboundClusterLinkPlaintext MigrationType = 3
	JumpClusterSaslScram                 MigrationType = 4
	JumpClusterIam                       MigrationType = 5
)

func ToMigrationType added in v0.5.0

func ToMigrationType(input string) (MigrationType, error)

func (MigrationType) IsValid added in v0.5.0

func (m MigrationType) IsValid() bool

func (MigrationType) RequiresSaslScram added in v0.8.0

func (m MigrationType) RequiresSaslScram() bool

type OSKClusterAuth added in v0.8.0

type OSKClusterAuth struct {
	ID                    string                `yaml:"id"`
	BootstrapServers      []string              `yaml:"bootstrap_servers"`
	AuthMethod            AuthMethodConfig      `yaml:"auth_method"`
	InsecureSkipTLSVerify bool                  `yaml:"insecure_skip_tls_verify,omitempty"` // Only set true for test environments with self-signed certs
	Metadata              OSKCredentialMetadata `yaml:"metadata,omitempty"`
	Jolokia               *JolokiaConfig        `yaml:"jolokia,omitempty"`
	Prometheus            *PrometheusConfig     `yaml:"prometheus,omitempty"`
}

OSKClusterAuth contains authentication details for a single OSK cluster

func (OSKClusterAuth) GetAuthMethods added in v0.8.0

func (c OSKClusterAuth) GetAuthMethods() []AuthType

GetAuthMethods returns the enabled authentication methods for this cluster. IAM is not supported for OSK, so it is excluded (includeIAM=false).

func (OSKClusterAuth) GetSelectedAuthType added in v0.8.0

func (c OSKClusterAuth) GetSelectedAuthType() (AuthType, error)

GetSelectedAuthType returns the selected auth type for the cluster

func (OSKClusterAuth) HasJolokiaConfig added in v0.8.0

func (c OSKClusterAuth) HasJolokiaConfig() bool

HasJolokiaConfig returns true if the cluster has Jolokia configuration

func (OSKClusterAuth) HasPrometheusConfig added in v0.8.0

func (c OSKClusterAuth) HasPrometheusConfig() bool

HasPrometheusConfig returns true if the cluster has Prometheus configuration

type OSKClusterMetadata added in v0.8.0

type OSKClusterMetadata struct {
	Environment  string            `json:"environment,omitempty"`
	Location     string            `json:"location,omitempty"`
	KafkaVersion string            `json:"kafka_version,omitempty"`
	Labels       map[string]string `json:"labels,omitempty"`
	LastScanned  time.Time         `json:"last_scanned"`
}

OSKClusterMetadata contains optional metadata about OSK clusters

type OSKCredentialMetadata added in v0.8.0

type OSKCredentialMetadata struct {
	Environment string            `yaml:"environment,omitempty"`
	Location    string            `yaml:"location,omitempty"`
	Labels      map[string]string `yaml:"labels,omitempty"`
}

OSKCredentialMetadata allows users to add optional organizational metadata

type OSKCredentials added in v0.8.0

type OSKCredentials struct {
	Clusters []OSKClusterAuth `yaml:"clusters"`
}

OSKCredentials represents the apache-kafka-credentials.yaml file

func NewOSKCredentialsFromFile added in v0.8.0

func NewOSKCredentialsFromFile(credentialsYamlPath string) (*OSKCredentials, []error)

NewOSKCredentialsFromFile loads OSK credentials from a YAML file

func (OSKCredentials) Validate added in v0.8.0

func (c OSKCredentials) Validate() (bool, []error)

Validate checks that the credentials file is valid

func (*OSKCredentials) WriteToFile added in v0.8.0

func (c *OSKCredentials) WriteToFile(filePath string) error

WriteToFile writes the credentials to a YAML file

type OSKDiscoveredCluster added in v0.8.0

type OSKDiscoveredCluster struct {
	ID                          string                      `json:"id"`
	BootstrapServers            []string                    `json:"bootstrap_servers"`
	KafkaAdminClientInformation KafkaAdminClientInformation `json:"kafka_admin_client_information"`
	ClusterMetrics              *ProcessedClusterMetrics    `json:"metrics,omitempty"`
	DiscoveredClients           []DiscoveredClient          `json:"discovered_clients"`
	Metadata                    OSKClusterMetadata          `json:"metadata"`
}

OSKDiscoveredCluster represents a discovered OSK cluster

type OSKSourcesState added in v0.8.0

type OSKSourcesState struct {
	Clusters []OSKDiscoveredCluster `json:"clusters"`
}

OSKSourcesState contains all OSK-specific data

type ProcessedClusterMetrics added in v0.4.0

type ProcessedClusterMetrics struct {
	Region     string                     `json:"region"`
	ClusterArn string                     `json:"cluster_arn"`
	Metadata   MetricMetadata             `json:"metadata"`
	Metrics    []ProcessedMetric          `json:"results"`
	Aggregates map[string]MetricAggregate `json:"aggregates"`
	QueryInfo  []MetricQueryInfo          `json:"query_info"`
	// OSK-specific fields (optional, omitempty for MSK clusters)
	Environment string `json:"environment,omitempty"`
	Location    string `json:"location,omitempty"`
}

type ProcessedMetric added in v0.4.0

type ProcessedMetric struct {
	Start string   `json:"start"`
	End   string   `json:"end"`
	Label string   `json:"label"`
	Value *float64 `json:"value"`
}

type PrometheusAuthConfig added in v0.8.0

type PrometheusAuthConfig struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

PrometheusAuthConfig holds HTTP basic auth credentials for Prometheus

type PrometheusConfig added in v0.8.0

type PrometheusConfig struct {
	URL    string                  `yaml:"url"`
	Auth   *PrometheusAuthConfig   `yaml:"auth,omitempty"`
	TLS    *PrometheusTLSConfig    `yaml:"tls,omitempty"`
	Filter *PrometheusFilterConfig `yaml:"filter,omitempty"`
	// Timeout overrides the HTTP client timeout for Prometheus queries. Zero
	// (unset) keeps the client's built-in default (30s). A longer value is
	// needed for large --metrics-range queries against high-cardinality
	// clusters, where the default can trip "context deadline exceeded" before
	// the server responds.
	Timeout time.Duration `yaml:"timeout,omitempty"`
	// MetricNames maps a logical broker-metric label (e.g. "BytesInPerSec") to
	// the base Prometheus series name this cluster's exporter actually exposes,
	// for exporters that relabel the standard series. The name is substituted
	// into kcp's existing query wrapping (sum/rate/selector), so filter.labels
	// injection continues to work. Keys must be one of the labels in
	// ValidBrokerMetricLabels(); unknown keys are rejected at load time.
	MetricNames map[string]string `yaml:"metric_names,omitempty"`
	// ConnectMetricNames maps a logical Connect-metric label (e.g. "task-count")
	// to the base Prometheus series name this cluster's exporter actually exposes,
	// for exporters that relabel the standard Connect series. Substituted into
	// kcp's existing query wrapping (sum / sum by (connector)), so filter.labels
	// injection continues to work. Keys must be one of ValidConnectMetricLabels();
	// unknown keys are rejected at load time.
	ConnectMetricNames map[string]string `yaml:"connect_metric_names,omitempty"`
}

PrometheusConfig holds Prometheus connection details for metrics queries

type PrometheusFilterConfig added in v0.8.4

type PrometheusFilterConfig struct {
	Labels map[string]string `yaml:"labels,omitempty"`
}

PrometheusFilterConfig holds label selectors to scope Prometheus queries to a specific target. When set, label selectors are appended to all PromQL queries (e.g. {job="confluent/connect-jmx-exporter"}).

type PrometheusTLSConfig added in v0.8.0

type PrometheusTLSConfig struct {
	CACert             string `yaml:"ca_cert,omitempty"`
	InsecureSkipVerify bool   `yaml:"insecure_skip_verify,omitempty"`
}

PrometheusTLSConfig holds TLS settings for Prometheus HTTPS connections

type RegionAuth added in v0.4.0

type RegionAuth struct {
	Name     string        `yaml:"name"`
	Clusters []ClusterAuth `yaml:"clusters"`
}

func (*RegionAuth) MergeClusterConfigs added in v0.4.0

func (ra *RegionAuth) MergeClusterConfigs(existingRegion RegionAuth)

MergeClusterConfigs preserves existing cluster auth configurations from the existing region

func (*RegionAuth) UpsertCluster added in v0.8.6

func (ra *RegionAuth) UpsertCluster(newCluster ClusterAuth)

UpsertCluster creates or replaces a single cluster auth by ARN, preserving the auth configs of every other cluster and merging auth-method config onto the replaced entry.

type SASLPlainConfig added in v0.7.2

type SASLPlainConfig struct {
	Use      bool   `yaml:"use"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
	CACert   string `yaml:"ca_cert,omitempty"` // optional CA cert path; its presence selects SASL_SSL (TLS) for both the source connection and the link truststore
	// UseTLS is an explicit, opt-in TLS signal that selects SASL_SSL when NO
	// ca_cert is supplied — a public/system-CA listener (e.g. Confluent Cloud)
	// trusted by the system trust store. ca_cert implies TLS on its own; UseTLS
	// covers the public-CA case where there is no custom CA to point at. Default
	// false preserves the historical rule (no ca_cert ⇒ SASL_PLAINTEXT).
	UseTLS bool `yaml:"tls,omitempty"`
}

type SASLScramConfig added in v0.2.7

type SASLScramConfig struct {
	Use       bool   `yaml:"use"`
	Username  string `yaml:"username"`
	Password  string `yaml:"password"`
	Mechanism string `yaml:"mechanism,omitempty"` // "SHA256" or "SHA512". MSK requires "SHA512", Apache Kafka commonly uses "SHA256"
	CACert    string `yaml:"ca_cert,omitempty"`   // optional CA cert path for SASL_SSL link truststore
}

type SchemaRegistriesState added in v0.7.2

type SchemaRegistriesState struct {
	ConfluentSchemaRegistry []SchemaRegistryInformation     `json:"confluent_schema_registry,omitempty"`
	AWSGlue                 []GlueSchemaRegistryInformation `json:"aws_glue,omitempty"`
}

SchemaRegistriesState holds schema registries organized by type

func (*SchemaRegistriesState) UpsertConfluentSchemaRegistry added in v0.7.2

func (s *SchemaRegistriesState) UpsertConfluentSchemaRegistry(sr SchemaRegistryInformation)

UpsertConfluentSchemaRegistry inserts or updates a Confluent SR entry, matched by URL

func (*SchemaRegistriesState) UpsertGlueSchemaRegistry added in v0.7.2

func (s *SchemaRegistriesState) UpsertGlueSchemaRegistry(gr GlueSchemaRegistryInformation)

UpsertGlueSchemaRegistry inserts or updates a Glue SR entry, matched by RegistryName+Region

type SchemaRegistryAuthType added in v0.4.2

type SchemaRegistryAuthType string

SchemaRegistryAuthType represents the different authentication types supported by Schema Registry

const (
	SchemaRegistryAuthTypeUnauthenticated SchemaRegistryAuthType = "Unauthenticated"
	SchemaRegistryAuthTypeBasicAuth       SchemaRegistryAuthType = "BasicAuth"
	SchemaRegistryAuthTypeMTLS            SchemaRegistryAuthType = "MTLS"
)

type SchemaRegistryInformation added in v0.4.2

type SchemaRegistryInformation struct {
	Type                 string                       `json:"type"`
	URL                  string                       `json:"url"`
	DefaultCompatibility schemaregistry.Compatibility `json:"default_compatibility"`
	Contexts             []string                     `json:"contexts"`
	Subjects             []Subject                    `json:"subjects"`
}

type SourceType added in v0.8.0

type SourceType string

SourceType represents the type of Kafka source

const (
	SourceTypeMSK SourceType = "msk"
	SourceTypeOSK SourceType = "osk"
)

func ParseSourceTypeFlag added in v0.8.4

func ParseSourceTypeFlag(flag string) (SourceType, error)

ParseSourceTypeFlag maps a user-facing --source-type flag value to the internal SourceType token. The Apache Kafka source is "apache-kafka" to users but is represented internally as "osk".

type State added in v0.4.0

type State struct {
	SchemaVersion    int                    `json:"schema_version"`
	MSKSources       *MSKSourcesState       `json:"msk_sources,omitempty"`
	OSKSources       *OSKSourcesState       `json:"osk_sources,omitempty"`
	SchemaRegistries *SchemaRegistriesState `json:"schema_registries,omitempty"`
	KcpBuildInfo     KcpBuildInfo           `json:"kcp_build_info"`
	Timestamp        time.Time              `json:"timestamp"`
	UpdatedAt        time.Time              `json:"updated_at,omitempty"`
	UpgradedFrom     string                 `json:"upgraded_from,omitempty"`
}

State represents the unified state file (kcp-state.json)

func NewStateFrom added in v0.4.0

func NewStateFrom(fromState *State) *State

func NewStateFromBytes added in v0.8.0

func NewStateFromBytes(data []byte) (*State, error)

func NewStateFromFile added in v0.4.0

func NewStateFromFile(stateFile string) (*State, error)

func (*State) GetClusterByArn added in v0.5.2

func (s *State) GetClusterByArn(clusterArn string) (*DiscoveredCluster, error)

func (*State) GetOSKClusterByID added in v0.8.0

func (s *State) GetOSKClusterByID(id string) (*OSKDiscoveredCluster, error)

GetOSKClusterByID looks up an OSK cluster by the user-provided ID from credentials

func (*State) GetRegion added in v0.8.12

func (s *State) GetRegion(name string) (*DiscoveredRegion, error)

GetRegion looks up a discovered MSK region by name. It returns an error naming the region if it is not present in the state file, so callers can reject a --region that was never discovered rather than silently doing nothing.

func (*State) PersistStateFile added in v0.4.0

func (s *State) PersistStateFile(stateFile string) error

func (*State) UpsertDiscoveredClients added in v0.5.2

func (s *State) UpsertDiscoveredClients(regionName string, clusterName string, discoveredClients []DiscoveredClient) error

func (*State) UpsertRegion added in v0.4.0

func (s *State) UpsertRegion(newRegion DiscoveredRegion)

func (*State) UpsertTargetedClusters added in v0.8.6

func (s *State) UpsertTargetedClusters(newRegion DiscoveredRegion)

UpsertTargetedClusters refreshes region-level data (costs, configurations) and creates or replaces only the clusters present in newRegion.Clusters, preserving every other existing cluster in the region. Used by targeted (--cluster-arn) discovery. If the region does not yet exist it is added as-is (fresh-state / new-region case).

func (*State) WriteReportCommands added in v0.4.5

func (s *State) WriteReportCommands(filePath string, stateFilePath string) error

func (*State) WriteToFile added in v0.4.0

func (s *State) WriteToFile(filePath string) error

type Subject added in v0.4.2

type Subject struct {
	Name          string                          `json:"name"`
	SchemaType    string                          `json:"schema_type"`
	Compatibility string                          `json:"compatibility,omitempty"`
	Versions      []schemaregistry.SchemaMetadata `json:"versions"`
	Latest        schemaregistry.SchemaMetadata   `json:"latest_schema"`
}

type SubnetInfo added in v0.2.2

type SubnetInfo struct {
	SubnetMskBrokerId int    `json:"subnet_msk_broker_id"`
	SubnetId          string `json:"subnet_id"`
	AvailabilityZone  string `json:"availability_zone"`
	PrivateIpAddress  string `json:"private_ip_address"`
	CidrBlock         string `json:"cidr_block"`
}

type TLSConfig added in v0.2.7

type TLSConfig struct {
	Use        bool   `yaml:"use"`
	CACert     string `yaml:"ca_cert"`
	ClientCert string `yaml:"client_cert"`
	ClientKey  string `yaml:"client_key"`
}

type TopicDetails added in v0.3.4

type TopicDetails struct {
	Name              string             `json:"name"`
	Partitions        int                `json:"partitions"`
	ReplicationFactor int                `json:"replication_factor"`
	Configurations    map[string]*string `json:"configurations"`
}

type TopicSummary added in v0.3.4

type TopicSummary struct {
	Topics                    int `json:"topics"`
	InternalTopics            int `json:"internal_topics"`
	TotalPartitions           int `json:"total_partitions"`
	TotalInternalPartitions   int `json:"total_internal_partitions"`
	CompactTopics             int `json:"compact_topics"`
	CompactInternalTopics     int `json:"compact_internal_topics"`
	CompactPartitions         int `json:"compact_partitions"`
	CompactInternalPartitions int `json:"compact_internal_partitions"`
	RemoteStorageTopics       int `json:"remote_storage_topics"`
}

func CalculateTopicSummaryFromDetails added in v0.3.4

func CalculateTopicSummaryFromDetails(topicDetails []TopicDetails) TopicSummary

type Topics added in v0.3.3

type Topics struct {
	Summary TopicSummary   `json:"summary"`
	Details []TopicDetails `json:"details"`
}

type UnauthenticatedPlaintextConfig added in v0.4.0

type UnauthenticatedPlaintextConfig struct {
	Use bool `yaml:"use"`
}

type UnauthenticatedTLSConfig added in v0.4.0

type UnauthenticatedTLSConfig struct {
	Use    bool   `yaml:"use"`
	CACert string `yaml:"ca_cert,omitempty"`
}

Jump to

Keyboard shortcuts

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