From 9711ba1bee9c5a6397245fbb73bd3cf9cd79866f Mon Sep 17 00:00:00 2001
From: Emanuele Sabellico
func WriteErrorCodes(f *os.File)
+
func (a *AdminClient) ControllerID(ctx context.Context) (controllerID int32, err error)
func (a *AdminClient) CreateTopics(ctx context.Context, topics []TopicSpecification, options ...CreateTopicsAdminOption) (result []TopicResult, err error)
func NewTestConsumerGroupMetadata(groupID string) (*ConsumerGroupMetadata, error)
type CreateTopicsAdminOption
type RebalanceCb
ConfigSourceStaticBroker = ConfigSource(C.RD_KAFKA_CONFIG_SOURCE_STATIC_BROKER_CONFIG)
// ConfigSourceDefault is built-in default configuration for configs that have a default value
ConfigSourceDefault = ConfigSource(C.RD_KAFKA_CONFIG_SOURCE_DEFAULT_CONFIG)
+)
+
const (
+ // ResourcePatternTypeUnknown is a resource pattern type not known or not set.
+ ResourcePatternTypeUnknown = ResourcePatternType(C.RD_KAFKA_RESOURCE_PATTERN_UNKNOWN)
+ // ResourcePatternTypeAny matches any resource, used for lookups.
+ ResourcePatternTypeAny = ResourcePatternType(C.RD_KAFKA_RESOURCE_PATTERN_ANY)
+ // ResourcePatternTypeMatch will perform pattern matching
+ ResourcePatternTypeMatch = ResourcePatternType(C.RD_KAFKA_RESOURCE_PATTERN_MATCH)
+ // ResourcePatternTypeLiteral matches a literal resource name
+ ResourcePatternTypeLiteral = ResourcePatternType(C.RD_KAFKA_RESOURCE_PATTERN_LITERAL)
+ // ResourcePatternTypePrefixed matches a prefixed resource name
+ ResourcePatternTypePrefixed = ResourcePatternType(C.RD_KAFKA_RESOURCE_PATTERN_PREFIXED)
+)
+ const (
+ // ACLOperationUnknown represents an unknown or unset operation
+ ACLOperationUnknown = ACLOperation(C.RD_KAFKA_ACL_OPERATION_UNKNOWN)
+ // ACLOperationAny in a filter, matches any ACLOperation
+ ACLOperationAny = ACLOperation(C.RD_KAFKA_ACL_OPERATION_ANY)
+ // ACLOperationAll represents all the operations
+ ACLOperationAll = ACLOperation(C.RD_KAFKA_ACL_OPERATION_ALL)
+ // ACLOperationRead a read operation
+ ACLOperationRead = ACLOperation(C.RD_KAFKA_ACL_OPERATION_READ)
+ // ACLOperationWrite represents a write operation
+ ACLOperationWrite = ACLOperation(C.RD_KAFKA_ACL_OPERATION_WRITE)
+ // ACLOperationCreate represents a create operation
+ ACLOperationCreate = ACLOperation(C.RD_KAFKA_ACL_OPERATION_CREATE)
+ // ACLOperationDelete represents a delete operation
+ ACLOperationDelete = ACLOperation(C.RD_KAFKA_ACL_OPERATION_DELETE)
+ // ACLOperationAlter represents an alter operation
+ ACLOperationAlter = ACLOperation(C.RD_KAFKA_ACL_OPERATION_ALTER)
+ // ACLOperationDescribe represents a describe operation
+ ACLOperationDescribe = ACLOperation(C.RD_KAFKA_ACL_OPERATION_DESCRIBE)
+ // ACLOperationClusterAction represents a cluster action operation
+ ACLOperationClusterAction = ACLOperation(C.RD_KAFKA_ACL_OPERATION_CLUSTER_ACTION)
+ // ACLOperationDescribeConfigs represents a describe configs operation
+ ACLOperationDescribeConfigs = ACLOperation(C.RD_KAFKA_ACL_OPERATION_DESCRIBE_CONFIGS)
+ // ACLOperationAlterConfigs represents an alter configs operation
+ ACLOperationAlterConfigs = ACLOperation(C.RD_KAFKA_ACL_OPERATION_ALTER_CONFIGS)
+ // ACLOperationIdempotentWrite represents an idempotent write operation
+ ACLOperationIdempotentWrite = ACLOperation(C.RD_KAFKA_ACL_OPERATION_IDEMPOTENT_WRITE)
+)
+ const (
+ // ACLPermissionTypeUnknown represents an unknown ACLPermissionType
+ ACLPermissionTypeUnknown = ACLPermissionType(C.RD_KAFKA_ACL_PERMISSION_TYPE_UNKNOWN)
+ // ACLPermissionTypeAny in a filter, matches any ACLPermissionType
+ ACLPermissionTypeAny = ACLPermissionType(C.RD_KAFKA_ACL_PERMISSION_TYPE_ANY)
+ // ACLPermissionTypeDeny disallows access
+ ACLPermissionTypeDeny = ACLPermissionType(C.RD_KAFKA_ACL_PERMISSION_TYPE_DENY)
+ // ACLPermissionTypeAllow grants access
+ ACLPermissionTypeAllow = ACLPermissionType(C.RD_KAFKA_ACL_PERMISSION_TYPE_ALLOW)
)
const (
// TimestampNotAvailable indicates no timestamp was set, or not available due to lacking broker support
@@ -1414,9 +1589,187 @@
librdkafka error codes.
This function is not intended for public use.
+ ACLBinding specifies the operation and permission type for a specific principal +over one or more resources of the same type. Used by `AdminClient.CreateACLs`, +returned by `AdminClient.DescribeACLs` and `AdminClient.DeleteACLs`. +
+type ACLBinding struct { + Type ResourceType // The resource type. + // The resource name, which depends on the resource type. + // For ResourceBroker the resource name is the broker id. + Name string + ResourcePatternType ResourcePatternType // The resource pattern, relative to the name. + Principal string // The principal this ACLBinding refers to. + Host string // The host that the call is allowed to come from. + Operation ACLOperation // The operation/s specified by this binding. + PermissionType ACLPermissionType // The permission type for the specified operation. +} ++
+ ACLBindingFilter specifies a filter used to return a list of ACL bindings matching some or all of its attributes. +Used by `AdminClient.DescribeACLs` and `AdminClient.DeleteACLs`. +
+type ACLBindingFilter = ACLBinding+
+ ACLBindingFilters is a slice of ACLBindingFilter that also implements +the sort interface +
+type ACLBindingFilters []ACLBindingFilter+
+ ACLBindings is a slice of ACLBinding that also implements +the sort interface +
+type ACLBindings []ACLBinding+
func (a ACLBindings) Len() int+
func (a ACLBindings) Less(i, j int) bool+
func (a ACLBindings) Swap(i, j int)+
+ ACLOperation enumerates the different types of ACL operation. +
+type ACLOperation int+
func ACLOperationFromString(aclOperationString string) (ACLOperation, error)+
+ ACLOperationFromString translates a ACL operation name to +a ACLOperation value. +
+func (o ACLOperation) String() string+
+ String returns the human-readable representation of an ACLOperation +
++ ACLPermissionType enumerates the different types of ACL permission types. +
+type ACLPermissionType int+
func ACLPermissionTypeFromString(aclPermissionTypeString string) (ACLPermissionType, error)+
+ ACLPermissionTypeFromString translates a ACL permission type name to +a ACLPermissionType value. +
+func (o ACLPermissionType) String() string+
+ String returns the human-readable representation of an ACLPermissionType +
Requires broker version >= 0.10.0.
+func (a *AdminClient) CreateACLs(ctx context.Context, aclBindings ACLBindings, options ...CreateACLsAdminOption) (result []CreateACLResult, err error)+
+ CreateACLs creates one or more ACL bindings. +
++ Parameters: +
+* `ctx` - context with the maximum amount of time to block, or nil for indefinite. +* `aclBindings` - A slice of ACL binding specifications to create. +* `options` - Create ACLs options ++
+ Returns a slice of CreateACLResult with a ErrNoError ErrorCode when the operation was successful +plus an error that is not nil for client level errors +
Note: TopicSpecification is analogous to NewTopic in the Java Topic Admin API.
+func (a *AdminClient) DeleteACLs(ctx context.Context, aclBindingFilters ACLBindingFilters, options ...DeleteACLsAdminOption) (result []DeleteACLsResult, err error)+
+ DeleteACLs deletes ACL bindings matching one or more ACL binding filters. +
++ Parameters: +
+* `ctx` - context with the maximum amount of time to block, or nil for indefinite. +* `aclBindingFilters` - a slice of ACL binding filters to match ACLs to delete. + string attributes match exact values or any string if set to empty string. + Enum attributes match exact values or any value if ending with `Any`. + If `ResourcePatternType` is set to `ResourcePatternTypeMatch` returns all + the ACL bindings with `ResourcePatternTypeLiteral`, `ResourcePatternTypeWildcard` + or `ResourcePatternTypePrefixed` pattern type that match the resource name. +* `options` - Delete ACLs options ++
+ Returns a slice of ACLBinding for each filter when the operation was successful +plus an error that is not `nil` for client level errors +
Requires broker version >= 0.10.1.0
+func (a *AdminClient) DescribeACLs(ctx context.Context, aclBindingFilter ACLBindingFilter, options ...DescribeACLsAdminOption) (result *DescribeACLsResult, err error)+
+ DescribeACLs matches ACL bindings by filter. +
++ Parameters: +
+* `ctx` - context with the maximum amount of time to block, or nil for indefinite. +* `aclBindingFilter` - A filter with attributes that must match. + string attributes match exact values or any string if set to empty string. + Enum attributes match exact values or any value if ending with `Any`. + If `ResourcePatternType` is set to `ResourcePatternTypeMatch` returns all + the ACL bindings with `ResourcePatternTypeLiteral`, `ResourcePatternTypeWildcard` + or `ResourcePatternTypePrefixed` pattern type that match the resource name. +* `options` - Describe ACLs options ++
+ Returns a slice of ACLBindings when the operation was successful +plus an error that is not `nil` for client level errors +
type AlterOperation int
type ConfigSource int
+ CreateACLResult provides create ACL error information. +
+type CreateACLResult struct {
+ // Error, if any, of result. Check with `Error.Code() != ErrNoError`.
+ Error Error
+}
+
+ + CreateACLsAdminOption - see setter. +
++ See SetAdminRequestTimeout +
+type CreateACLsAdminOption interface {
+ // contains filtered or unexported methods
+}
type CreateTopicsAdminOption interface {
// contains filtered or unexported methods
}
+ + DeleteACLsAdminOption - see setter. +
++ See SetAdminRequestTimeout +
+type DeleteACLsAdminOption interface {
+ // contains filtered or unexported methods
+}
+ + DeleteACLsResult provides delete ACLs result or error information. +
+type DeleteACLsResult = DescribeACLsResult
type DeleteTopicsAdminOption interface {
// contains filtered or unexported methods
}
+ + DescribeACLsAdminOption - see setter. +
++ See SetAdminRequestTimeout +
+type DescribeACLsAdminOption interface {
+ // contains filtered or unexported methods
+}
+ + DescribeACLsResult provides describe ACLs result or error information. +
+type DescribeACLsResult struct { + // Slice of ACL bindings matching the provided filter + ACLBindings ACLBindings + // Error, if any, of result. Check with `Error.Code() != ErrNoError`. + Error Error +} +
type RebalanceCb func(*Consumer, Event) error+
+ ResourcePatternType enumerates the different types of Kafka resource patterns. +
+type ResourcePatternType int+
func ResourcePatternTypeFromString(patternTypeString string) (ResourcePatternType, error)+
+ ResourcePatternTypeFromString translates a resource pattern type name to +a ResourcePatternType value. +
+func (t ResourcePatternType) String() string+
+ String returns the human-readable representation of a ResourcePatternType +
type ResourceType int
func (tps TopicPartitions) Swap(i, j int)