formatter

package
v0.0.0-...-520f1c6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecorateAttr

func DecorateAttr(attrString, message string) string

func DefaultValue

func DefaultValue(val, def string) string

DefaultValue returns default value if string is empty

func FormatCatalogName

func FormatCatalogName(catalogName string) string

FormatCatalogName returns name of catalog from which the resource is

func FormatCategories

func FormatCategories(categories []*client.CategoryResponseBody) string

FormatCategories returns list of categories seperated by comma

func FormatDesc

func FormatDesc(desc string, num int) string

FormatDesc returns first 40 char of resource description

func FormatInstallCMD

func FormatInstallCMD(res hub.ResourceData, resVer hub.ResourceWithVersionData, latest bool) string

FormatInstallCMD returns install command to be executed to install the resource

func FormatJSON

func FormatJSON(b []byte) ([]byte, error)

FormatJSON returns formatted json string

func FormatName

func FormatName(name, latestVersion string) string

FormatName returns name of resource with its latest version

func FormatPlatforms

func FormatPlatforms(platforms []*client.PlatformResponseBody) string

FormatPlatforms returns list of platforms seperated by comma

func FormatTags

func FormatTags(tags []*client.TagResponseBody) string

FormatTags returns list of tags seperated by comma

func FormatVersion

func FormatVersion(version string, latest bool, deprecated bool) string

FormatVersion returns version appended with (latest) if the latest field passed is true

func Icon

func Icon(title string) string

Icon returns icon for a title passed

func WrapText

func WrapText(desc string, maxWidth, titleLength int) string

WrapText returns description broken down in multiple lines with max width passed to it titleLength would be the length of title on left hand side before the text starts, so the length of text in first line would be maxwidth - titleLength

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL