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 IsValidResourceOperation(resourceType string, operation string, ...) (bool, []string)
- func MapACLsToTableRows(bindings []kafkainstanceclient.AclBinding, localizer localize.Localizer) []permissionsRow
- func RegisterGroupCompletionFunc(cmd *cobra.Command, f *factory.Factory) error
- func RegisterTopicCompletionFunc(cmd *cobra.Command, f *factory.Factory) error
- 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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
func GetResourceTypeMap() map[string]kafkainstanceclient.AclResourceType
GetResourceTypeMap gets the mappings for ACL resource types
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 RegisterGroupCompletionFunc ¶
RegisterGroupCompletionFunc enables dynamic autocompletion for group flag
func RegisterTopicCompletionFunc ¶
RegisterTopicCompletionFunc enables dynamic autocompletion for topic flag
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 ¶
func ValidateAndSetResources(opts *CrudOptions, resourceTypeFlagEntries []*localize.TemplateEntry) error
ValidateAndSetResources validates and sets resources options
Types ¶
type CrudOptions ¶
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