Documentation ¶
Index ¶
- Constants
- func BuildInstructions(errorCollection []error) error
- func ExecuteACLRuleCreate(req kafkainstanceclient.ApiCreateAclRequest, localizer localize.Localizer, ...) error
- func FormatPrincipal(userID string) string
- func GetMappedOperationFilterValue(operation string) kafkainstanceclient.AclOperationFilter
- func GetMappedOperationValue(operation string) kafkainstanceclient.AclOperation
- func GetMappedPatternTypeFilterValue(patternType string) kafkainstanceclient.AclPatternTypeFilter
- func GetMappedPatternTypeValue(patternType string) kafkainstanceclient.AclPatternType
- func GetMappedPermissionTypeFilterValue(permission string) kafkainstanceclient.AclPermissionTypeFilter
- func GetMappedPermissionTypeValue(permission string) kafkainstanceclient.AclPermissionType
- func GetMappedResourceTypeFilterValue(resourceType string) kafkainstanceclient.AclResourceTypeFilter
- func GetOperationFilterMap() map[string]kafkainstanceclient.AclOperationFilter
- func GetOperationMap() map[string]kafkainstanceclient.AclOperation
- func GetPatternTypeFilterMap() map[string]kafkainstanceclient.AclPatternTypeFilter
- func GetPatternTypeMap() map[string]kafkainstanceclient.AclPatternType
- func GetPermissionTypeFilterMap() map[string]kafkainstanceclient.AclPermissionTypeFilter
- func GetPermissionTypeMap() map[string]kafkainstanceclient.AclPermissionType
- func GetResourceName(resourceName string) string
- func GetResourceTypeFilterMap() map[string]kafkainstanceclient.AclResourceTypeFilter
- func GetResourceTypeMap() map[string]kafkainstanceclient.AclResourceType
- func GetReversedOperationMap() map[kafkainstanceclient.AclOperation]string
- func IsValidResourceOperation(resourceType string, operation string, ...) (bool, []string)
- func MapACLsToTableRows(bindings []kafkainstanceclient.AclBinding, localizer localize.Localizer) []permissionsRow
- func ValidateAPIError(httpRes *http.Response, localizer localize.Localizer, err error, ...) error
- func ValidateAndSetResources(opts *CrudOptions, resourceTypeFlagEntries []*localize.TemplateEntry) error
- type CrudOptions
Constants ¶
const ( Wildcard = "*" KafkaCluster = "kafka-cluster" AllAlias = "all" )
const ( ResourceTypeANY = "any" ResourceTypeTOPIC = "topic" ResourceTypeCLUSTER = "cluster" ResourceTypeGROUP = "group" ResourceTypeTRANSACTIONAL_ID = "transactional-id" )
const ( PermissionALLOW = "allow" PermissionDENY = "deny" PermissionANY = "any" )
const ( OperationALL = "all" OperationREAD = "read" OperationWRITE = "write" OperationCREATE = "create" OperationDELETE = "delete" OperationALTER = "alter" OperationDESCRIBE = "describe" OperationDESCRIBE_CONFIGS = "describe-configs" OperationALTER_CONFIGS = "alter-configs" )
const ( PatternTypeLITERAL = "literal" PatternTypePREFIX = "prefix" PatternTypeANY = "any" )
Variables ¶
This section is empty.
Functions ¶
func BuildInstructions ¶ added in v0.36.5
BuildInstructions accepts a slice of errors and creates a single formatted error object
func ExecuteACLRuleCreate ¶
func ExecuteACLRuleCreate(req kafkainstanceclient.ApiCreateAclRequest, localizer localize.Localizer, kafkaInstanceName string) error
ExecuteACLRuleCreate makes request to create an ACL rule
func FormatPrincipal ¶
FormatPrincipal formats the provided principal ID to "User:principal"
func GetMappedOperationFilterValue ¶
func GetMappedOperationFilterValue(operation string) kafkainstanceclient.AclOperationFilter
GetMappedOperationFilterValue gets the mapped operation filter value
func GetMappedOperationValue ¶ added in v0.36.0
func GetMappedOperationValue(operation string) kafkainstanceclient.AclOperation
GetMappedOperationValue gets the mapped operation value
func GetMappedPatternTypeFilterValue ¶
func GetMappedPatternTypeFilterValue(patternType string) kafkainstanceclient.AclPatternTypeFilter
GetMappedPatternTypeFilterValue gets the mapped pattern type filter value
func GetMappedPatternTypeValue ¶ added in v0.36.0
func GetMappedPatternTypeValue(patternType string) kafkainstanceclient.AclPatternType
GetMappedPatternTypeValue gets the mapped pattern type value
func GetMappedPermissionTypeFilterValue ¶
func GetMappedPermissionTypeFilterValue(permission string) kafkainstanceclient.AclPermissionTypeFilter
GetMappedPermissionTypeFilterValue gets the mapped permission type filter value
func GetMappedPermissionTypeValue ¶ added in v0.36.0
func GetMappedPermissionTypeValue(permission string) kafkainstanceclient.AclPermissionType
GetMappedPermissionTypeValue gets the mapped permission type value
func GetMappedResourceTypeFilterValue ¶
func GetMappedResourceTypeFilterValue(resourceType string) kafkainstanceclient.AclResourceTypeFilter
GetMappedResourceTypeFilterValue gets the mapped resource type filter value
func GetOperationFilterMap ¶
func GetOperationFilterMap() map[string]kafkainstanceclient.AclOperationFilter
GetOperationTypeFilterMap gets the mappings for ACL type filters
func GetOperationMap ¶ added in v0.36.0
func GetOperationMap() map[string]kafkainstanceclient.AclOperation
func GetPatternTypeFilterMap ¶
func GetPatternTypeFilterMap() map[string]kafkainstanceclient.AclPatternTypeFilter
GetPatternTypeFilterMap gets the mappings for ACL pattern type filters
func GetPatternTypeMap ¶ added in v0.36.0
func GetPatternTypeMap() map[string]kafkainstanceclient.AclPatternType
GetPatternTypeMap gets the mappings for ACL pattern type
func GetPermissionTypeFilterMap ¶
func GetPermissionTypeFilterMap() map[string]kafkainstanceclient.AclPermissionTypeFilter
GetPermissionTypeFilterMap gets the mappings for ACL permission type filters
func GetPermissionTypeMap ¶ added in v0.36.0
func GetPermissionTypeMap() map[string]kafkainstanceclient.AclPermissionType
GetPermissionTypeMap gets the mappings for ACL permission types
func GetResourceName ¶
GetResourceName returns the name of the resource transformed into a server recognized format
func GetResourceTypeFilterMap ¶
func GetResourceTypeFilterMap() map[string]kafkainstanceclient.AclResourceTypeFilter
GetResourceTypeFilterMap gets the mappings for ACL resource type filters
func GetResourceTypeMap ¶ added in v0.36.2
func GetResourceTypeMap() map[string]kafkainstanceclient.AclResourceType
GetResourceTypeMap gets the mappings for ACL resource types
func GetReversedOperationMap ¶ added in v0.36.1
func GetReversedOperationMap() map[kafkainstanceclient.AclOperation]string
GetReversedOperationMap returns a map of operations with the SDK enums as the keys
func IsValidResourceOperation ¶
func IsValidResourceOperation(resourceType string, operation string, resourceOperationsMap map[string][]string) (bool, []string)
IsValidResourceOperation checks if the operation is valid, and returns the list valid operations when invalid
func MapACLsToTableRows ¶
func MapACLsToTableRows(bindings []kafkainstanceclient.AclBinding, localizer localize.Localizer) []permissionsRow
MapACLsToTableRows converts a list of ACL bindings into a formatted table for printing
func ValidateAPIError ¶
func ValidateAPIError(httpRes *http.Response, localizer localize.Localizer, err error, operation string, instanceName string) error
ValidateAPIError checks for a HTTP error and maps it to a user friendly error
func ValidateAndSetResources ¶ added in v0.36.0
func ValidateAndSetResources(opts *CrudOptions, resourceTypeFlagEntries []*localize.TemplateEntry) error
ValidateAndSetResources validates and sets resources options
Types ¶
type CrudOptions ¶ added in v0.36.0
type CrudOptions struct { Config config.IConfig Connection factory.ConnectionFunc Logger logging.Logger IO *iostreams.IOStreams Localizer localize.Localizer Context context.Context Cluster bool PatternType string ResourceType string ResourceName string Permission string Operation string Group string Topic string TransactionalID string Principal string SkipConfirm bool Output string InstanceID string }
CrudOptions is the interface used for options of create and delete command