Documentation ¶
Index ¶
- Constants
- Variables
- func FilterValidConsumerGroupIDs(f *factory.Factory, toComplete string) (validIDs []string, directive cobra.ShellCompDirective)
- func FilterValidTopicNameArgs(f *factory.Factory, toComplete string) (validNames []string, directive cobra.ShellCompDirective)
- func FindCloudProviderByName(cloudProviders []kafkamgmtclient.CloudProvider, name string) *kafkamgmtclient.CloudProvider
- func GetAPIError(err error) *kafkamgmtclient.Error
- func GetCloudProviderCompletionValues(f *factory.Factory) (validProviders []string, directive cobra.ShellCompDirective)
- func GetEnabledCloudProviderNames(cloudProviders []kafkamgmtclient.CloudProvider) []string
- func GetEnabledCloudRegionIDs(regions []kafkamgmtclient.CloudRegion) []string
- func GetKafkaByID(ctx context.Context, api kafkamgmtclient.DefaultApi, id string) (*kafkamgmtclient.KafkaRequest, *http.Response, error)
- func GetKafkaByName(ctx context.Context, api kafkamgmtclient.DefaultApi, name string) (*kafkamgmtclient.KafkaRequest, *http.Response, error)
- func InteractiveSelect(ctx context.Context, connection connection.Connection, logger logging.Logger, ...) (*kafkamgmtclient.KafkaRequest, error)
- func InvalidNameError(v string) error
- func InvalidSearchValueError(v string) error
- func IsErr(err error, code ServiceErrorCode) bool
- func NotFoundByIDError(id string) error
- func NotFoundByNameError(name string) error
- func RegisterNameFlagCompletionFunc(cmd *cobra.Command, f *factory.Factory) error
- type Error
- type ServiceErrorCode
Constants ¶
const ( // ErrorCode7 Resource not found ErrorCode7 = "KAFKAS-MGMT-7" // ErrorCode24 The maximum number of allowed kafka instances has been reached ErrorCode24 = "KAFKAS-MGMT-24" // ErrorCode21 Bad Request ErrorCode21 = "KAFKAS-MGMT-21" // ErrorCode36 Kafka cluster name is already used ErrorCode36 = "KAFKAS-MGMT-36" )
Variables ¶
var ( NotFoundByIDErr error NotFoundByNameErr error IllegalSearchValueError error InvalidNameErr error )
Functions ¶
func FilterValidConsumerGroupIDs ¶
func FilterValidConsumerGroupIDs(f *factory.Factory, toComplete string) (validIDs []string, directive cobra.ShellCompDirective)
FilterValidConsumerGroupIDs returns the list of consumer group IDs from the API
func FilterValidTopicNameArgs ¶
func FilterValidTopicNameArgs(f *factory.Factory, toComplete string) (validNames []string, directive cobra.ShellCompDirective)
FilterValidTopicNameArgs filters topics from the API and returns the names This is used in for dynamic completion of topic names
func FindCloudProviderByName ¶
func FindCloudProviderByName(cloudProviders []kafkamgmtclient.CloudProvider, name string) *kafkamgmtclient.CloudProvider
FindCloudProviderByName finds and returns a cloud provider item from the list by its name
func GetAPIError ¶
func GetAPIError(err error) *kafkamgmtclient.Error
GetAPIError gets a strongly typed error from an error
func GetCloudProviderCompletionValues ¶
func GetCloudProviderCompletionValues(f *factory.Factory) (validProviders []string, directive cobra.ShellCompDirective)
GetCloudProviderCompletionValues returns the list of supported cloud providers for creating a Kafka instance This is used in the cmd.RegisterFlagCompletionFunc for dynamic completion of --provider
func GetEnabledCloudProviderNames ¶
func GetEnabledCloudProviderNames(cloudProviders []kafkamgmtclient.CloudProvider) []string
GetEnabledCloudProviderNames returns a list of cloud provider names from the enabled cloud providers
func GetEnabledCloudRegionIDs ¶
func GetEnabledCloudRegionIDs(regions []kafkamgmtclient.CloudRegion) []string
GetEnabledCloudRegionIDs extracts and returns a slice of the unique IDs of all enabled regions
func GetKafkaByID ¶
func GetKafkaByID(ctx context.Context, api kafkamgmtclient.DefaultApi, id string) (*kafkamgmtclient.KafkaRequest, *http.Response, error)
func GetKafkaByName ¶
func GetKafkaByName(ctx context.Context, api kafkamgmtclient.DefaultApi, name string) (*kafkamgmtclient.KafkaRequest, *http.Response, error)
func InteractiveSelect ¶
func InteractiveSelect(ctx context.Context, connection connection.Connection, logger logging.Logger, localizer localize.Localizer) (*kafkamgmtclient.KafkaRequest, error)
func InvalidNameError ¶
func InvalidSearchValueError ¶
func IsErr ¶
func IsErr(err error, code ServiceErrorCode) bool
IsErr returns true if the error contains the errCode
func NotFoundByIDError ¶
func NotFoundByNameError ¶
Types ¶
type ServiceErrorCode ¶
type ServiceErrorCode string