client

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 41 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

This section is empty.

Variables

View Source
var ErrJolokiaMBeanNotFound = errors.New("jolokia: MBean/instance not found")

ErrJolokiaMBeanNotFound is a sentinel error indicating the requested MBean or instance does not exist on the target JVM (HTTP 404, Jolokia status 404, or an InstanceNotFoundException from the JMX layer). Callers can use errors.Is to distinguish this expected/normal condition (e.g. a sink-task MBean pattern on a source-only Connect cluster) from real failures such as connection timeouts or auth errors.

Functions

func IsUnsupportedListGroupsVersion added in v0.9.1

func IsUnsupportedListGroupsVersion(err error) bool

IsUnsupportedListGroupsVersion reports whether a raw ListGroups error means the broker is too old for that request version (KIP-848 v5 needs a >= 3.8 broker). When true, the caller downgrades the version and retries. Scoped to UNSUPPORTED_VERSION so genuine failures (auth, connection) still surface as errors (design §6).

func NewCloudWatchClient

func NewCloudWatchClient(region string) (*cloudwatch.Client, error)

func NewCostExplorerClient

func NewCostExplorerClient(region string) (*costexplorer.Client, error)

func NewEC2Client added in v0.2.2

func NewEC2Client(region string) (*ec2.Client, error)

func NewGlueClient added in v0.7.2

func NewGlueClient(ctx context.Context, region string) (*glue.Client, error)

func NewIAMClient added in v0.2.1

func NewIAMClient() (*iam.Client, error)

func NewKafkaClient added in v0.7.0

func NewKafkaClient(brokerAddresses []string, region string, opts ...AdminOption) (sarama.Client, error)

NewKafkaClient creates a sarama.Client (not a ClusterAdmin) for offset fetching. Uses the same auth configuration options as NewKafkaAdmin.

func NewMSKConnectClient added in v0.4.0

func NewMSKConnectClient(region string) (*kafkaconnect.Client, error)

func NewS3Client added in v0.2.2

func NewS3Client(region string) (*s3.Client, error)

func NewSchemaRegistryClient added in v0.4.2

func NewSchemaRegistryClient(url string, opts ...SchemaRegistryOption) (schemaregistry.Client, error)

NewSchemaRegistryClient creates a new Schema Registry client for the given URL

func ValidateConfluentSchemaRegistryURL added in v0.8.7

func ValidateConfluentSchemaRegistryURL(rawURL string, opts ...SchemaRegistryOption) error

ValidateConfluentSchemaRegistryURL performs a pre-flight GET against the Schema Registry's /config endpoint (the same endpoint the scan's first call hits) and returns a clear, class-distinct error when the endpoint is not a usable Schema Registry. It honors the same auth options as the scan and returns nil only when the endpoint responds 2xx with a JSON body.

It exists because confluent-kafka-go decodes any 2xx body as JSON without checking Content-Type; pointing --url at an HTML endpoint otherwise surfaces the opaque "invalid character '<' looking for beginning of value".

Types

type AdminConfig

type AdminConfig struct {
	// contains filtered or unexported fields
}

AdminConfig holds the configuration for creating a Kafka admin client

type AdminOption

type AdminOption func(*AdminConfig)

AdminOption is a function type for configuring the Kafka admin client

func AdminOptionForAuthMethod added in v0.8.6

func AdminOptionForAuthMethod(authType types.AuthType, auth types.AuthMethodConfig, skipTLSVerify bool) (AdminOption, error)

AdminOptionForAuthMethod maps an auth type + method config to the corresponding AdminOption. skipTLSVerify is threaded into EVERY TLS-bearing path (SASL/SCRAM, SASL/PLAIN-over-TLS, unauthenticated-TLS, mTLS) so a caller does not need a separate WithInsecureSkipVerify() override; IAM is MSK-only (AWS public CA), so it never skips. A supplied ca_cert is plumbed through so a custom CA is trusted on the source connection itself — not only in the cluster-link truststore. IAM lives here, in the client package — never in the osk package (Apache Kafka has no IAM).

func WithIAMAuth

func WithIAMAuth() AdminOption

WithIAMAuth configures the admin client to use IAM authentication

func WithInsecureSkipVerify added in v0.7.2

func WithInsecureSkipVerify() AdminOption

WithInsecureSkipVerify disables TLS certificate verification. Prefer the per-auth insecureSkipTLSVerify parameter on the With*Auth builders; this standalone override remains for callers that set auth and skip separately.

func WithSASLPlainAuth added in v0.7.0

func WithSASLPlainAuth(username, password, caCertFile string, insecureSkipTLSVerify bool) AdminOption

WithSASLPlainAuth configures SASL/PLAIN over TLS (SASL_SSL) — used for Confluent Cloud and any TLS-wrapped SASL/PLAIN listener. insecureSkipTLSVerify disables certificate verification (test envs only). For a cleartext SASL_PLAINTEXT listener use WithSASLPlainAuthNoTLS.

func WithSASLPlainAuthNoTLS added in v0.7.2

func WithSASLPlainAuthNoTLS(username, password string) AdminOption

WithSASLPlainAuthNoTLS configures SASL/PLAIN authentication without TLS encryption. Used for source clusters on SASL_PLAINTEXT listeners. For TLS-wrapped SASL/PLAIN (SASL_SSL) use WithSASLPlainAuth.

func WithSASLSCRAMAuth

func WithSASLSCRAMAuth(username, password, mechanism, caCertFile string, insecureSkipTLSVerify bool) AdminOption

WithSASLSCRAMAuth configures the admin client to use SASL/SCRAM authentication. Set insecureSkipTLSVerify to true only in test environments with self-signed certificates.

func WithTLSAuth

func WithTLSAuth(caCertFile string, clientCertFile string, clientKeyFile string, insecureSkipTLSVerify bool) AdminOption

WithTLSAuth configures mutual TLS (client cert + key). insecureSkipTLSVerify disables server-certificate verification (test envs only).

func WithTopicAutoCreationDisabled added in v0.11.0

func WithTopicAutoCreationDisabled() AdminOption

WithTopicAutoCreationDisabled makes every metadata request the client sends ask the broker not to create a missing topic. sarama asks it to by default (Metadata.AllowAutoTopicCreation), so a client that looks up a topic deleted mid-run, on a broker with auto.create.topics.enable, would recreate it empty. Off by default: every existing client keeps sarama's default. A route conversion's high-water-mark sweep sets it.

func WithUnauthenticatedPlaintextAuth added in v0.4.0

func WithUnauthenticatedPlaintextAuth() AdminOption

func WithUnauthenticatedTlsAuth added in v0.4.0

func WithUnauthenticatedTlsAuth(caCertFile string, insecureSkipTLSVerify bool) AdminOption

WithUnauthenticatedTlsAuth configures one-way (server-only) TLS with no client auth. insecureSkipTLSVerify disables certificate verification (test envs only).

type ClusterKafkaMetadata

type ClusterKafkaMetadata struct {
	Brokers      []*sarama.Broker
	ControllerID int32
	ClusterID    string
}

ClusterKafkaMetadata represents cluster information including brokers, controller, and cluster ID

type CommittedOffset added in v0.11.0

type CommittedOffset struct {
	Offset   int64
	Metadata string
}

CommittedOffset is one partition's committed position and the metadata string the committing client stored with it (Kafka Streams keeps per-partition stream time there). Both are carried to the destination.

type ConsumerGroupClient added in v0.9.1

type ConsumerGroupClient struct {
	// contains filtered or unexported fields
}

ConsumerGroupClient is an isolated Kafka client pinned at 3.8.0 (see NewConsumerGroupClient) used only for consumer-group discovery. It does not alter the 3.6-era clients used by the rest of scanning (design §4.3).

func NewConsumerGroupClient added in v0.9.1

func NewConsumerGroupClient(brokerAddresses []string, region string, opts ...AdminOption) (*ConsumerGroupClient, error)

NewConsumerGroupClient builds an ISOLATED client pinned at Kafka 3.8.0 — the version required for KIP-848 ListGroups v5 (the group `type` field). It reuses kcp's existing auth options; it does NOT alter the 3.6-era clients used by the rest of scanning (design §4.3).

func (*ConsumerGroupClient) CanCommitAnyOffsets added in v0.11.0

func (c *ConsumerGroupClient) CanCommitAnyOffsets(ctx context.Context) (bool, error)

CanCommitAnyOffsets reports whether the connected principal may commit offsets for an arbitrary consumer group on an arbitrary topic: READ on the group and READ on the topic, which a conversion's offset write needs and the DESCRIBE probes do not prove. It sends one admin OffsetCommit (v7, generation -1, no member, leader epoch -1, the same request CommitGroupOffsets sends) for a group and a topic that do not exist.

The broker authorizes READ on the group, then READ on each topic, and only then checks that the topic exists. A request left with no authorized, existing topic never reaches the group coordinator, so nothing is written and no group is created (verified live on cp-server with StandardAuthorizer before this was built). UNKNOWN_TOPIC_OR_PARTITION means allowed; GROUP_AUTHORIZATION_FAILED or TOPIC_AUTHORIZATION_FAILED means denied, as does a coordinator lookup the broker refuses for the group. Any other answer is an error: a probe that could not be asked is neither allowed nor denied. A connection error is retried (internal/retry) on a fresh connection; a denial is a result, never retried.

func (*ConsumerGroupClient) CanDescribeAnyGroup added in v0.11.0

func (c *ConsumerGroupClient) CanDescribeAnyGroup(ctx context.Context) (bool, error)

CanDescribeAnyGroup reports whether the connected principal may describe an arbitrary consumer group, by asking about a group that does not exist. A credential that may not describe groups gets a silently filtered ListGroups (no error) and cannot read the offsets of the groups it can't see, so a conversion that trusted its listing would verify only part of the cluster.

The broker authorizes DESCRIBE on the group name before saying anything about it: a principal that may describe it is told the group is "Dead" (it does not exist), one that may not is told GROUP_AUTHORIZATION_FAILED. This tests what actually matters on every authorizer seen so far. Cluster DESCRIBE does not: on open-source Kafka it shows every group but not their offsets, and on MSK IAM it neither implies nor is needed for a complete listing, so a "cluster DESCRIBE" probe can pass while the listing is empty.

A connection error is retried (internal/retry) on a fresh connection; a denial is a result, never retried.

func (*ConsumerGroupClient) CanDescribeAnyTopic added in v0.11.0

func (c *ConsumerGroupClient) CanDescribeAnyTopic(ctx context.Context) (bool, error)

CanDescribeAnyTopic reports whether the connected principal may describe an arbitrary topic, by asking about one that does not exist. A credential that may not gets a silently filtered topic list and, worse, an all-topics OffsetFetch that quietly leaves out the topics it can't see: a group's commit on such a topic never appears, so the conversion would treat the topic as untracked and never verify it.

The broker authorizes DESCRIBE on the topic name before saying whether it exists: a principal that may describe the name is told UNKNOWN_TOPIC_OR_PARTITION, one that may not is told TOPIC_AUTHORIZATION_FAILED. The group probe cannot see this: a credential that may describe every group can still be unable to describe some topics.

A connection error is retried (internal/retry) on a fresh connection; a denial is a result, never retried.

func (*ConsumerGroupClient) Close added in v0.9.1

func (c *ConsumerGroupClient) Close() error

Close closes the underlying client. The admin was created via NewClusterAdminFromClient and shares this client, so it is NOT closed separately here — that would double-close it.

func (*ConsumerGroupClient) CommitGroupOffsets added in v0.11.0

func (c *ConsumerGroupClient) CommitGroupOffsets(ctx context.Context, group string, offsets map[string]map[int32]CommittedOffset) error

CommitGroupOffsets writes one group's offsets to this cluster as a single admin commit (see buildGroupCommit). A connection error, or a coordinator that moved or is still loading, is retried (see retryGroupOp). Anything else, including a group that has live members (UNKNOWN_MEMBER_ID) or a credential without READ on the group or topic, is an error naming the group, topic and partition, and is not retried.

func (*ConsumerGroupClient) CommittedOffsets added in v0.11.0

func (c *ConsumerGroupClient) CommittedOffsets(ctx context.Context, group string) (map[string]map[int32]CommittedOffset, error)

CommittedOffsets returns one group's committed offsets and their metadata, topic -> partition -> committed offset, offsets >= 0 only.

func (*ConsumerGroupClient) Coordinators added in v0.9.1

func (c *ConsumerGroupClient) Coordinators(groupIDs []string) map[string]string

Coordinators resolves each group's coordinator broker address, best-effort — it never errors; groups whose coordinator cannot be resolved are simply omitted from the result.

func (*ConsumerGroupClient) DescribeGroups added in v0.9.1

func (c *ConsumerGroupClient) DescribeGroups(groupIDs []string) ([]*sarama.GroupDescription, error)

DescribeGroups describes the given consumer groups via the admin client's standard DescribeConsumerGroups call.

func (*ConsumerGroupClient) ListGroupsAllBrokers added in v0.11.0

func (c *ConsumerGroupClient) ListGroupsAllBrokers(ctx context.Context) ([]types.ConsumerGroupListing, error)

ListGroupsAllBrokers is ListGroupsWithType without the tolerance: each broker reports only the groups it coordinates, so one silent broker hides its groups, and a caller making a safety decision from the listing must not get a partial one. It errors if any broker fails or refuses. It refreshes the broker list first: the client's is from its last metadata read, so a broker added or replaced since would go unasked and its groups would be missing. A connection error retries the whole listing (internal/retry), after closing the connections of the brokers that failed; a broker's refusal is not retried.

func (*ConsumerGroupClient) ListGroupsWithType added in v0.9.1

func (c *ConsumerGroupClient) ListGroupsWithType() ([]types.ConsumerGroupListing, error)

ListGroupsWithType lists every consumer group on the cluster along with its KIP-848 type, via the raw ListGroups v5 request (falling back to v4 — no type — on brokers older than 3.8). No type filter is set, so all group types are returned. resp.GroupsData is populated only for v4+, and GroupType only for v5; on a v4 fallback Type stays "". Best-effort: a broker that fails is warned about and skipped; it errors only when no broker answers.

func (*ConsumerGroupClient) PartitionCounts added in v0.11.0

func (c *ConsumerGroupClient) PartitionCounts(ctx context.Context, topics []string) (map[string]int, error)

PartitionCounts returns the partition count of each named topic that exists on the cluster. A topic the broker says does not exist is left out of the map, not an error: a conversion reads a missing count as "no copy on this cluster". Like the topic probe it asks one broker directly with auto-creation off, because the client's own metadata refresh defaults to creating a missing topic. A connection error is retried (internal/retry) on a fresh connection; a denial is a result, never retried.

type ConsumerGroupScanner added in v0.9.1

type ConsumerGroupScanner interface {
	ListGroupsWithType() ([]types.ConsumerGroupListing, error)
	DescribeGroups(groupIDs []string) ([]*sarama.GroupDescription, error)
	Coordinators(groupIDs []string) map[string]string
	Close() error
}

ConsumerGroupScanner is the group-discovery surface the collector depends on (kept small so it can be mocked).

type GroupWorker added in v0.11.0

type GroupWorker struct {
	// contains filtered or unexported fields
}

GroupWorker is one worker of a fan-out over consumer groups (a conversion's snapshots and apply, and reconcile's committed-topics fetch), spanned as kafka.group_worker. Each group costs the worker two round trips: finding the group's coordinator, then the request itself (OffsetFetch or OffsetCommit). The client's group calls find the worker in their context and add both up on it, every attempt included, so the span shows where the worker's time went without a span per group, which at tens of thousands of groups would swamp the trace. A GroupWorker belongs to one goroutine, so it takes no lock.

func StartGroupWorker added in v0.11.0

func StartGroupWorker(ctx context.Context, i int) (context.Context, *GroupWorker)

StartGroupWorker opens worker i's kafka.group_worker span, a child of the span in ctx, and returns a context that carries the worker to the client's group calls.

func (*GroupWorker) End added in v0.11.0

func (w *GroupWorker) End(err error)

End records the worker's totals on its span and closes it, recording err when it is non-nil: kcp.groups (groups finished), kcp.coordinators (distinct coordinator brokers it asked), kcp.coordinator_lookup.* and kcp.request.* (count, total_ms, max_ms), and kcp.request.api once it has sent a request.

func (*GroupWorker) GroupDone added in v0.11.0

func (w *GroupWorker) GroupDone()

GroupDone counts one group the worker finished.

type JolokiaClient added in v0.8.0

type JolokiaClient struct {
	// contains filtered or unexported fields
}

JolokiaClient is an HTTP client for querying Jolokia REST endpoints

func NewJolokiaClient added in v0.8.0

func NewJolokiaClient(baseURL string, opts ...JolokiaOption) *JolokiaClient

NewJolokiaClient creates a new Jolokia HTTP client

func (*JolokiaClient) BaseURL added in v0.8.0

func (c *JolokiaClient) BaseURL() string

BaseURL returns the Jolokia endpoint base URL

func (*JolokiaClient) ReadMBean added in v0.8.0

func (c *JolokiaClient) ReadMBean(ctx context.Context, mbeanPath string) (map[string]any, error)

ReadMBean queries a Jolokia endpoint for JMX MBean data mbeanPath is the MBean ObjectName (e.g., "kafka.server:type=BrokerTopicMetrics,name=BytesInPerSec") Returns the "value" map from the Jolokia response

func (*JolokiaClient) ReadMBeanAggregate added in v0.8.0

func (c *JolokiaClient) ReadMBeanAggregate(ctx context.Context, mbeanPattern string, attribute string) (float64, error)

ReadMBeanAggregate queries a wildcard MBean pattern and sums a numeric attribute across all matching MBeans. Used for metrics like log size (per-partition) and connection count (per-listener) that need to be aggregated.

func (*JolokiaClient) ReadMBeanAggregateByLabel added in v0.8.12

func (c *JolokiaClient) ReadMBeanAggregateByLabel(ctx context.Context, mbeanPattern, attribute, labelKey string) (map[string]float64, error)

ReadMBeanAggregateByLabel queries a wildcard MBean pattern and sums a numeric attribute grouped by the value of an ObjectName property (labelKey, e.g. "connector"). Unlike ReadMBeanAggregate (which collapses everything into one total), this returns one summed value per distinct labelKey value, so per-connector/per-task metrics can be attributed to their connector. MBeans whose ObjectName lacks labelKey are skipped.

type JolokiaOption added in v0.8.0

type JolokiaOption func(*JolokiaClient)

JolokiaOption is a functional option for configuring the JolokiaClient

func WithJolokiaBasicAuth added in v0.8.0

func WithJolokiaBasicAuth(username, password string) JolokiaOption

WithJolokiaBasicAuth configures the client to use HTTP basic authentication

func WithJolokiaTLS added in v0.8.0

func WithJolokiaTLS(caPool *x509.CertPool, insecureSkipVerify bool) JolokiaOption

WithJolokiaTLS configures TLS, trusting caPool (nil → system roots) and honoring insecureSkipVerify. The caller builds caPool via utils.CACertPool so a bad/unreadable CA fails closed at construction rather than being silently ignored here.

type KafkaAdmin

type KafkaAdmin interface {
	ListTopicsWithConfigs() (map[string]sarama.TopicDetail, error)
	ListTopicsWithNonDefaultConfigs() (map[string]sarama.TopicDetail, error)
	ListTopicInternalFlags(ctx context.Context) (map[string]bool, error)
	GetClusterKafkaMetadata() (*ClusterKafkaMetadata, error)
	ClusterID(ctx context.Context) (string, error)
	DescribeConfig() ([]sarama.ConfigEntry, error)
	ListAcls() ([]sarama.ResourceAcls, error)
	Close() error
}

KafkaAdmin interface defines the Kafka admin operations we need

func NewKafkaAdmin

func NewKafkaAdmin(brokerAddresses []string, clientBrokerEncryptionInTransit kafkatypes.ClientBroker, region string, kafkaVersion string, opts ...AdminOption) (KafkaAdmin, error)

NewKafkaAdmin creates a new Kafka admin client for the given broker addresses and region

type KafkaAdminClient

type KafkaAdminClient struct {
	// contains filtered or unexported fields
}

KafkaAdminClient wraps sarama.ClusterAdmin to implement our KafkaAdmin interface

func (*KafkaAdminClient) Close

func (k *KafkaAdminClient) Close() error

func (*KafkaAdminClient) ClusterID added in v0.11.0

func (k *KafkaAdminClient) ClusterID(ctx context.Context) (string, error)

ClusterID reads the cluster's own id, as GetClusterKafkaMetadata does, retrying a connection error (internal/retry) after closing the controller's connection. Migration paths call it; scan keeps GetClusterKafkaMetadata's single attempt.

func (*KafkaAdminClient) DescribeConfig

func (k *KafkaAdminClient) DescribeConfig() ([]sarama.ConfigEntry, error)

func (*KafkaAdminClient) GetClusterKafkaMetadata

func (k *KafkaAdminClient) GetClusterKafkaMetadata() (*ClusterKafkaMetadata, error)

func (*KafkaAdminClient) ListAcls added in v0.1.3

func (k *KafkaAdminClient) ListAcls() ([]sarama.ResourceAcls, error)

func (*KafkaAdminClient) ListTopicInternalFlags added in v0.11.0

func (k *KafkaAdminClient) ListTopicInternalFlags(ctx context.Context) (map[string]bool, error)

ListTopicInternalFlags returns every topic of an all-topics metadata request, keyed by name, with the broker's own IsInternal flag. Brokers include the Kafka-internal topics (__consumer_offsets, __transaction_state) in that response; unlike ListTopicsWithConfigs (which reports them like any other topic, and whose output scan depends on), this exposes the flag so a caller that wants user topics only can drop them by the broker's word rather than by a name prefix. It sends no DescribeConfigs request. A connection error is retried (internal/retry) after closing the controller's connection.

func (*KafkaAdminClient) ListTopicsWithConfigs added in v0.3.4

func (k *KafkaAdminClient) ListTopicsWithConfigs() (map[string]sarama.TopicDetail, error)

A custom implementation of the ListTopics() function in Sarama that returns all topic configs instead of just overridden configs. This was done to reduce the number of requests to the broker. https://github.com/IBM/sarama/blob/main/admin.go#L349

func (*KafkaAdminClient) ListTopicsWithNonDefaultConfigs added in v0.8.12

func (k *KafkaAdminClient) ListTopicsWithNonDefaultConfigs() (map[string]sarama.TopicDetail, error)

ListTopicsWithNonDefaultConfigs is like ListTopicsWithConfigs but ConfigEntries contains only configs explicitly set at the topic level (DYNAMIC_TOPIC_CONFIG, sarama.SourceTopic), not server/broker/static defaults — the set faithful for recreating a topic.

type MSKAccessTokenProvider

type MSKAccessTokenProvider struct {
	// contains filtered or unexported fields
}

MSKAccessTokenProvider implements sarama.AccessTokenProvider for MSK IAM authentication

func (*MSKAccessTokenProvider) Token

type PrometheusClient added in v0.8.0

type PrometheusClient struct {
	// contains filtered or unexported fields
}

PrometheusClient is an HTTP client for querying the Prometheus API

func NewPrometheusClient added in v0.8.0

func NewPrometheusClient(baseURL string, opts ...PrometheusOption) *PrometheusClient

NewPrometheusClient creates a new Prometheus HTTP client

func (*PrometheusClient) BaseURL added in v0.8.0

func (c *PrometheusClient) BaseURL() string

BaseURL returns the Prometheus server base URL

func (*PrometheusClient) QueryRange added in v0.8.0

func (c *PrometheusClient) QueryRange(ctx context.Context, query string, start, end time.Time, step time.Duration) ([]PrometheusMetricResult, error)

QueryRange executes a Prometheus range query and returns parsed results

type PrometheusDataPoint added in v0.8.0

type PrometheusDataPoint struct {
	Timestamp time.Time
	Value     float64
}

PrometheusDataPoint is a single timestamp+value pair from a Prometheus query

type PrometheusMetricResult added in v0.8.0

type PrometheusMetricResult struct {
	MetricName string
	Labels     map[string]string
	Values     []PrometheusDataPoint
}

PrometheusMetricResult holds the parsed result for a single metric from a range query

type PrometheusOption added in v0.8.0

type PrometheusOption func(*PrometheusClient)

PrometheusOption is a functional option for configuring the PrometheusClient

func WithPrometheusBasicAuth added in v0.8.0

func WithPrometheusBasicAuth(username, password string) PrometheusOption

WithPrometheusBasicAuth configures the client to use HTTP basic authentication

func WithPrometheusTLS added in v0.8.0

func WithPrometheusTLS(caPool *x509.CertPool, insecureSkipVerify bool) PrometheusOption

WithPrometheusTLS configures TLS, trusting caPool (nil → system roots) and honoring insecureSkipVerify. The caller builds caPool via utils.CACertPool so a bad/unreadable CA fails closed at construction rather than being silently ignored here.

func WithPrometheusTimeout added in v0.9.2

func WithPrometheusTimeout(timeout time.Duration) PrometheusOption

WithPrometheusTimeout overrides the HTTP client timeout used for Prometheus queries (default 30s, set in NewPrometheusClient). 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.

type RateLimitedMSKClient added in v0.5.2

type RateLimitedMSKClient struct {
	*kafka.Client
	// contains filtered or unexported fields
}

func NewMSKClient

func NewMSKClient(region string, requestsPerSecond float64, burstSize int) (*RateLimitedMSKClient, error)

func (*RateLimitedMSKClient) DescribeTopic added in v0.5.2

func (c *RateLimitedMSKClient) DescribeTopic(ctx context.Context, params *kafka.DescribeTopicInput, optFns ...func(*kafka.Options)) (*kafka.DescribeTopicOutput, error)

Clusters with high topic count are likely to hit the 429 rate limnit errors. Therefore, we implement an additional layer of retries outside the AWS SDK's standard retryer. If we hit a 429 or quota error, we wait for a new token from our rate limiter and try again.

func (*RateLimitedMSKClient) Wait added in v0.5.2

type SchemaRegistryConfig added in v0.4.2

type SchemaRegistryConfig struct {
	// contains filtered or unexported fields
}

SchemaRegistryConfig holds the configuration for creating a Schema Registry client

type SchemaRegistryOption added in v0.4.2

type SchemaRegistryOption func(*SchemaRegistryConfig)

SchemaRegistryOption is a function type for configuring the Schema Registry client

func WithBasicAuth added in v0.4.2

func WithBasicAuth(username, password string) SchemaRegistryOption

WithBasicAuth configures the Schema Registry client to use basic authentication

func WithMTLS added in v0.8.12

func WithMTLS(clientCert, clientKey string) SchemaRegistryOption

WithMTLS configures mutual-TLS authentication: kcp presents clientCert/clientKey to the schema registry. Pair with WithTLS to trust a private/internal server CA.

func WithTLS added in v0.8.12

func WithTLS(caCert string, insecureSkip bool) SchemaRegistryOption

WithTLS configures TLS transport for an HTTPS Schema Registry endpoint. It is orthogonal to the auth method: caCert (empty → system trust roots) verifies the server's certificate against a private/internal CA, and insecureSkip disables certificate verification entirely (test environments only). Both are applied by injecting a custom HTTPClient in NewSchemaRegistryClient — NOT via the confluent client's SslCaLocation/SslDisableEndpointVerification fields (the latter only logs and never actually skips verification).

func WithUnauthenticated added in v0.4.2

func WithUnauthenticated() SchemaRegistryOption

WithUnauthenticated configures the Schema Registry client to use no authentication

type XDGSCRAMClient

type XDGSCRAMClient struct {
	*scram.Client
	*scram.ClientConversation
	scram.HashGeneratorFcn
}

func (*XDGSCRAMClient) Begin

func (x *XDGSCRAMClient) Begin(userName, password, authzID string) (err error)

func (*XDGSCRAMClient) Done

func (x *XDGSCRAMClient) Done() bool

func (*XDGSCRAMClient) Step

func (x *XDGSCRAMClient) Step(challenge string) (response string, err error)

Jump to

Keyboard shortcuts

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