Documentation ¶
Overview ¶
Copyright 2020 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- func MakeAdminClient(clientID string, kafkaAuthCfg *utils.KafkaAuthConfig, ...) (sarama.ClusterAdmin, error)
- func NewConfig(ctx context.Context) ([]string, *sarama.Config, error)
- func NewProducer(ctx context.Context) (sarama.Client, error)
- func NewTLSConfig(clientCert, clientKey, caCert string) (*tls.Config, error)
- func UpdateSaramaConfigWithKafkaAuthConfig(saramaConf *sarama.Config, kafkaAuthCfg *utils.KafkaAuthConfig) error
- type AdapterNet
- type AdapterSASL
- type AdapterTLS
- type XDGSCRAMClient
Constants ¶
This section is empty.
Variables ¶
var SHA256 scram.HashGeneratorFcn = func() hash.Hash { return sha256.New() }
SHA256 hash generator function for SCRAM conversation
var SHA512 scram.HashGeneratorFcn = func() hash.Hash { return sha512.New() }
SHA512 hash generator function for SCRAM conversation
Functions ¶
func MakeAdminClient ¶ added in v0.19.1
func MakeAdminClient(clientID string, kafkaAuthCfg *utils.KafkaAuthConfig, bootstrapServers []string) (sarama.ClusterAdmin, error)
func NewProducer ¶
NewProducer is a helper method for constructing a client for producing kafka methods.
func NewTLSConfig ¶ added in v0.19.1
NewTLSConfig returns a *tls.Config using the given ceClient cert, ceClient key, and CA certificate. If none are appropriate, a nil *tls.Config is returned.
func UpdateSaramaConfigWithKafkaAuthConfig ¶ added in v0.19.1
func UpdateSaramaConfigWithKafkaAuthConfig(saramaConf *sarama.Config, kafkaAuthCfg *utils.KafkaAuthConfig) error
Types ¶
type AdapterNet ¶
type AdapterNet struct { SASL AdapterSASL TLS AdapterTLS }
type AdapterSASL ¶
type AdapterTLS ¶
type XDGSCRAMClient ¶ added in v0.19.1
type XDGSCRAMClient struct { *scram.Client *scram.ClientConversation scram.HashGeneratorFcn }
XDGSCRAMClient struct to perform SCRAM conversation
func (*XDGSCRAMClient) Begin ¶ added in v0.19.1
func (x *XDGSCRAMClient) Begin(userName, password, authzID string) (err error)
Begin starts SCRAM conversation
func (*XDGSCRAMClient) Done ¶ added in v0.19.1
func (x *XDGSCRAMClient) Done() bool
Done completes SCRAM conversation