// ListCatalog lists all the available service types
ListCatalog lists all the available service types
// ListCatalog lists all the available service types
func ListCatalog(client *occlient.Client) ([]occlient.Service, error) {
	clusterServiceClasses, err := client.GetClusterServiceClassExternalNamesAndPlans()
	if err != nil {
		return nil, errors.Wrapf(err, "unable to get cluster serviceClassExternalName")
	}
	sort.Slice(clusterServiceClasses, func(i, j int) bool {
		return clusterServiceClasses[i].Name < clusterServiceClasses[j].Name
	})
	return clusterServiceClasses, nil
}
func ListCatalog ( client * occlient . Client ) ( [ ] occlient . Service , error ) { clusterServiceClasses , err := client . GetClusterServiceClassExternalNamesAndPlans ( ) if err != nil { return nil , errors . Wrapf ( err , " " ) } sort . Slice ( clusterServiceClasses , func ( i , j int ) bool { return clusterServiceClasses [ i ] . Name < clusterServiceClasses [ j ] . Name } ) return clusterServiceClasses , nil }
ListCatalog lists all the available service types
ListCatalog lists all the available service types
// Sorting service classes alphabetically // Reference: https://golang.org/pkg/sort/#example_Slice