Documentation
¶
Index ¶
- Constants
- func Age(t, currentTime time.Time) string
- func ChainRunE(fns ...func(cmd *cobra.Command, args []string) error) func(cmd *cobra.Command, args []string) error
- func DatacenterToSchema(datacenter hcloud.Datacenter) schema.Datacenter
- func Datetime(t time.Time) string
- func DeprecatableResourceToSchema(deprecatableResource hcloud.DeprecatableResource) schema.DeprecatableResource
- func DescribeDeprecation(resource hcloud.Deprecatable) string
- func DescribeFormat(object interface{}, format string) error
- func DescribeJSON(object interface{}) error
- func ExactlyOneSet(s string, ss ...string) bool
- func ISOToSchema(iso hcloud.ISO) schema.ISO
- func ImageToSchema(image hcloud.Image) schema.Image
- func LabelsToString(labels map[string]string) string
- func ListLongDescription(intro string, columns []string) string
- func LoadBalancerTypeToSchema(loadBalancerType hcloud.LoadBalancerType) schema.LoadBalancerType
- func LocationToSchema(location hcloud.Location) schema.Location
- func NA(s string) string
- func PlacementGroupToSchema(placementGroup hcloud.PlacementGroup) schema.PlacementGroup
- func PrefixLines(text, prefix string) string
- func ServerTypeToSchema(serverType hcloud.ServerType) schema.ServerType
- func SplitLabel(label string) []string
- func SplitLabelVars(label string) (string, string)
- func ValidateRequiredFlags(flags *pflag.FlagSet, names ...string) error
- func YesNo(b bool) string
Constants ¶
View Source
const ( Byte = 1 Kibibyte = Byte * 1024 Mebibyte = Kibibyte * 1024 Gibibyte = Mebibyte * 1024 Tebibyte = Gibibyte * 1024 )
Variables ¶
This section is empty.
Functions ¶
func DatacenterToSchema ¶
func DatacenterToSchema(datacenter hcloud.Datacenter) schema.Datacenter
func DeprecatableResourceToSchema ¶ added in v1.35.0
func DeprecatableResourceToSchema(deprecatableResource hcloud.DeprecatableResource) schema.DeprecatableResource
func DescribeDeprecation ¶ added in v1.35.0
func DescribeDeprecation(resource hcloud.Deprecatable) string
func DescribeFormat ¶
func DescribeJSON ¶
func DescribeJSON(object interface{}) error
func ExactlyOneSet ¶
func LabelsToString ¶
func ListLongDescription ¶
func LoadBalancerTypeToSchema ¶
func LoadBalancerTypeToSchema(loadBalancerType hcloud.LoadBalancerType) schema.LoadBalancerType
func PlacementGroupToSchema ¶ added in v1.31.0
func PlacementGroupToSchema(placementGroup hcloud.PlacementGroup) schema.PlacementGroup
func PrefixLines ¶ added in v1.35.0
PrefixLines will prefix all individual lines in the text with the passed prefix.
func ServerTypeToSchema ¶
func ServerTypeToSchema(serverType hcloud.ServerType) schema.ServerType
func SplitLabel ¶
func SplitLabelVars ¶ added in v1.23.0
SplitLabelVars splits up label into key and value and returns them as separate return values. If label doesn't contain the `=` separator, SplitLabelVars returns the original string as key, with an empty value.
func ValidateRequiredFlags ¶ added in v1.22.0
ValidateRequiredFlags ensures that flags has values for all flags with the passed names.
This function duplicates the functionality cobra provides when calling MarkFlagRequired. However, in some cases a flag cannot be marked as required in cobra, for example when it depends on other flags. In those cases this function comes in handy.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.