Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ListCmd = base.ListCmd{ ResourceNamePlural: "Load Balancer Types", DefaultColumns: []string{"id", "name", "description", "max_services", "max_connections", "max_targets"}, Fetch: func(ctx context.Context, client hcapi2.Client, cmd *cobra.Command, listOpts hcloud.ListOpts) ([]interface{}, error) { loadBalancerTypes, _, err := client.LoadBalancerType().List(ctx, hcloud.LoadBalancerTypeListOpts{ListOpts: listOpts}) var resources []interface{} for _, r := range loadBalancerTypes { resources = append(resources, r) } return resources, err }, OutputTable: func(client hcapi2.Client) *output.Table { return output.NewTable(). AddAllowedFields(hcloud.LoadBalancerType{}) }, JSONSchema: func(resources []interface{}) interface{} { var loadBalancerTypeSchemas []schema.LoadBalancerType for _, resource := range resources { loadBalancerType := resource.(*hcloud.LoadBalancerType) loadBalancerTypeSchemas = append(loadBalancerTypeSchemas, util.LoadBalancerTypeToSchema(*loadBalancerType)) } return loadBalancerTypeSchemas }, }
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.