kafka

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2025 License: MIT Imports: 30 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SHA256 scram.HashGeneratorFcn = func() hash.Hash { return sha256.New() }
View Source
var SHA512 scram.HashGeneratorFcn = func() hash.Hash { return sha512.New() }

Functions

func ACLOperationToString added in v0.2.5

func ACLOperationToString(in sarama.AclOperation) string

ACLOperationToString converts sarama.AclOperations to a String representation

func ACLPermissionTypeToString added in v0.2.5

func ACLPermissionTypeToString(in sarama.AclPermissionType) string

ACLPermissionTypeToString converts sarama.AclPermissionTypes to Strings

func ACLResourceToString added in v0.2.5

func ACLResourceToString(in sarama.AclResourceType) string

func MapEq

func MapEq(result, expected map[string]*string) error

MapEq compares two maps, and checks that the keys and values are the same

func NewTLSConfig added in v0.2.3

func NewTLSConfig(clientCert, clientKey, caCert, clientKeyPassphrase string) (*tls.Config, error)

func Provider

func Provider() *schema.Provider

func ReplicaCount

func ReplicaCount(c sarama.Client, topic string, partitions []int32) (int, error)

ReplicaCount returns the replication_factor for a partition Returns an error if it cannot determine the count, or if the number of replicas is different across partitions

Types

type ACL

type ACL struct {
	Principal      string `json:"principal"`
	Host           string `json:"host"`
	Operation      string `json:"operation"`
	PermissionType string `json:"permission_type"`
}

type Client

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

func NewClient

func NewClient(config *Config) (*Client, error)

func (*Client) AddPartitions

func (c *Client) AddPartitions(t Topic) error

func (*Client) AlterQuota added in v0.4.2

func (c *Client) AlterQuota(quota Quota, validateOnly bool) error

func (*Client) AlterReplicationFactor added in v0.3.0

func (c *Client) AlterReplicationFactor(t Topic) error

func (*Client) CanAlterReplicationFactor added in v0.3.0

func (c *Client) CanAlterReplicationFactor() bool

func (*Client) CreateACL

func (c *Client) CreateACL(s StringlyTypedACL) error

func (*Client) CreateTopic

func (c *Client) CreateTopic(t Topic) error

func (*Client) DeleteACL

func (c *Client) DeleteACL(s StringlyTypedACL) error

func (*Client) DeleteTopic

func (c *Client) DeleteTopic(t string) error

func (*Client) DeleteUserScramCredential added in v0.5.3

func (c *Client) DeleteUserScramCredential(userScramCredential UserScramCredential) error

func (*Client) DescribeACLs added in v0.2.5

func (c *Client) DescribeACLs(s StringlyTypedACL) ([]*sarama.ResourceAcls, error)

DescribeACLs get ResourceAcls for a specific resource

func (*Client) DescribeQuota added in v0.4.2

func (c *Client) DescribeQuota(entityType string, entityName string) (*Quota, error)

func (*Client) DescribeUserScramCredential added in v0.5.3

func (c *Client) DescribeUserScramCredential(username string, mechanism string) (*UserScramCredential, error)

func (*Client) InvalidateACLCache added in v0.8.0

func (c *Client) InvalidateACLCache()

func (*Client) IsReplicationFactorUpdating added in v0.3.0

func (c *Client) IsReplicationFactorUpdating(topic string) (bool, error)

func (*Client) ListACLs

func (c *Client) ListACLs() ([]*sarama.ResourceAcls, error)

func (*Client) ReadTopic

func (client *Client) ReadTopic(name string, refreshMetadata bool) (Topic, error)

func (*Client) SaramaClient added in v0.2.3

func (c *Client) SaramaClient() sarama.Client

func (*Client) UpdateTopic

func (c *Client) UpdateTopic(topic Topic) error

func (*Client) UpsertUserScramCredential added in v0.5.3

func (c *Client) UpsertUserScramCredential(userScramCredential UserScramCredential) error

type Config

type Config struct {
	BootstrapServers                       *[]string
	Timeout                                int
	CACert                                 string
	ClientCert                             string
	ClientCertKey                          string
	ClientCertKeyPassphrase                string
	KafkaVersion                           string
	TLSEnabled                             bool
	SkipTLSVerify                          bool
	SASLUsername                           string
	SASLPassword                           string
	SASLMechanism                          string
	SASLAWSContainerAuthorizationTokenFile string
	SASLAWSContainerCredentialsFullUri     string
	SASLAWSRegion                          string
	SASLAWSRoleArn                         string
	SASLAWSExternalId                      string
	SASLAWSProfile                         string
	SASLAWSAccessKey                       string
	SASLAWSSecretKey                       string
	SASLAWSToken                           string
	SASLAWSCredsDebug                      bool
	SASLTokenUrl                           string
}

func (*Config) Token added in v0.7.0

func (c *Config) Token() (*sarama.AccessToken, error)

type LazyClient added in v0.2.4

type LazyClient struct {
	Config *Config
	// contains filtered or unexported fields
}

func (*LazyClient) AddPartitions added in v0.2.4

func (c *LazyClient) AddPartitions(t Topic) error

func (*LazyClient) AlterQuota added in v0.4.2

func (c *LazyClient) AlterQuota(q Quota) error

func (*LazyClient) AlterReplicationFactor added in v0.3.0

func (c *LazyClient) AlterReplicationFactor(t Topic) error

func (*LazyClient) CanAlterReplicationFactor added in v0.3.0

func (c *LazyClient) CanAlterReplicationFactor() (bool, error)

func (*LazyClient) CreateACL added in v0.2.4

func (c *LazyClient) CreateACL(s StringlyTypedACL) error

func (*LazyClient) CreateTopic added in v0.2.4

func (c *LazyClient) CreateTopic(t Topic) error

func (*LazyClient) DeleteACL added in v0.2.4

func (c *LazyClient) DeleteACL(s StringlyTypedACL) error

func (*LazyClient) DeleteTopic added in v0.2.4

func (c *LazyClient) DeleteTopic(t string) error

func (*LazyClient) DeleteUserScramCredential added in v0.5.3

func (c *LazyClient) DeleteUserScramCredential(userScramCredential UserScramCredential) error

func (*LazyClient) DescribeQuota added in v0.4.2

func (c *LazyClient) DescribeQuota(entityType string, entityName string) (*Quota, error)

func (*LazyClient) DescribeUserScramCredential added in v0.5.3

func (c *LazyClient) DescribeUserScramCredential(username string, mechanism string) (*UserScramCredential, error)

func (*LazyClient) InvalidateACLCache added in v0.8.0

func (c *LazyClient) InvalidateACLCache() error

func (*LazyClient) IsReplicationFactorUpdating added in v0.3.0

func (c *LazyClient) IsReplicationFactorUpdating(topic string) (bool, error)

func (*LazyClient) ListACLs added in v0.2.4

func (c *LazyClient) ListACLs() ([]*sarama.ResourceAcls, error)

func (*LazyClient) ReadTopic added in v0.2.4

func (c *LazyClient) ReadTopic(name string, refresh_metadata bool) (Topic, error)

func (*LazyClient) UpdateTopic added in v0.2.4

func (c *LazyClient) UpdateTopic(t Topic) error

func (*LazyClient) UpsertUserScramCredential added in v0.5.3

func (c *LazyClient) UpsertUserScramCredential(userScramCredential UserScramCredential) error

type OAuth2Config added in v0.7.0

type OAuth2Config interface {
	Token(ctx context.Context) (*oauth2.Token, error)
}

type Quota added in v0.4.2

type Quota struct {
	EntityType string
	EntityName string
	Ops        []QuotaOp
}

func (Quota) ID added in v0.4.2

func (a Quota) ID() string

func (Quota) String added in v0.4.2

func (a Quota) String() string

type QuotaMissingError added in v0.4.2

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

func (QuotaMissingError) Error added in v0.4.2

func (e QuotaMissingError) Error() string

type QuotaOp added in v0.4.2

type QuotaOp struct {
	Key    string
	Value  float64
	Remove bool
}

type Resource

type Resource struct {
	Type              string `json:"type"`
	Name              string `json:"name"`
	PatternTypeFilter string `json:"pattern_type_filter"`
}

type StringlyTypedACL added in v0.2.3

type StringlyTypedACL struct {
	ACL      ACL `json:"acl"`
	Resource `json:"resource"`
}

func (StringlyTypedACL) String added in v0.2.3

func (a StringlyTypedACL) String() string

type Topic

type Topic struct {
	Name              string
	Partitions        int32
	ReplicationFactor int16
	Config            map[string]*string
}

func (*Topic) Equal

func (t *Topic) Equal(other Topic) bool

type TopicMissingError

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

func (TopicMissingError) Error

func (e TopicMissingError) Error() string

type UserScramCredential added in v0.5.3

type UserScramCredential struct {
	Name       string
	Mechanism  sarama.ScramMechanismType
	Iterations int32
	Password   []byte
}

func (UserScramCredential) ID added in v0.5.3

func (usc UserScramCredential) ID() string

func (UserScramCredential) String added in v0.5.3

func (usc UserScramCredential) String() string

type UserScramCredentialMissingError added in v0.5.3

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

func (UserScramCredentialMissingError) Error added in v0.5.3

type XDGSCRAMClient added in v0.2.0

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

func (*XDGSCRAMClient) Begin added in v0.2.0

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

func (*XDGSCRAMClient) Done added in v0.2.0

func (x *XDGSCRAMClient) Done() bool

func (*XDGSCRAMClient) Step added in v0.2.0

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