Documentation ¶
Index ¶
- func ByteToHumanReadableFormat(b int) string
- func CommonElementsInStringSlice(s1 []string, s2 []string) (arr []string)
- func DisplayURL(urlStr string) string
- func Editor(opts EditorOptions) string
- func FmtDuration(d time.Duration) string
- func Humanize(s string) string
- func Indent(s, indent string) string
- func IsValidURL(toTest string) bool
- func Map[T1, T2 any](elems []T1, fn func(T1) T2) []T2
- func OpenInBrowser(url, browserType string) error
- func Pluralize(num int, thing string) string
- func PresentInIntSlice(hay []int, needle int) bool
- func PresentInStringSlice(hay []string, needle string) bool
- func PrettyTimeAgo(ago time.Duration) string
- func RenderMarkdown(text, glamourStyle string) (string, error)
- func RenderMarkdownWithoutIndentations(text, glamourStyle string) (string, error)
- func ReplaceNonAlphaNumericChars(words, replaceWith string) string
- func StringToInt(str string) int
- func TimeToPrettyTimeAgo(d time.Time) string
- type EditorOptions
- type ListTitleOptions
- type MarkdownRenderOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommonElementsInStringSlice ¶
CommonElementsInStringSlice takes 2 Slices of Strings and returns a Third Slice that is the common elements between the first 2 Slices.
func DisplayURL ¶
func Editor ¶
func Editor(opts EditorOptions) string
func FmtDuration ¶
func IsValidURL ¶
isValidUrl tests a string to determine if it is a well-structured url or not.
func Map ¶ added in v1.26.0
func Map[T1, T2 any](elems []T1, fn func(T1) T2) []T2
Map transfers the elements of its first argument using the result of the second fn(e)
func OpenInBrowser ¶
OpenInBrowser opens the url in a web browser based on OS and $BROWSER environment variable
func PresentInIntSlice ¶
PresentInIntSlice take a Hay (Slice of Ints) and a Needle (int) and returns true based on whether or not the Needle is present in the hay.
func PresentInStringSlice ¶
PresentInStringSlice take a Hay (Slice of Strings) and a Needle (string) and returns true based on whether or not the Needle is present in the hay.
func PrettyTimeAgo ¶
func RenderMarkdown ¶
func ReplaceNonAlphaNumericChars ¶
ReplaceNonAlphaNumericChars : Replaces non alpha-numeric values with provided char/string
func StringToInt ¶
func TimeToPrettyTimeAgo ¶
Types ¶
type EditorOptions ¶
type ListTitleOptions ¶
type ListTitleOptions struct { // Name of the List to be used in constructing Description and EmptyMessage if not provided. Name string // Page represents the page number of the current page Page int // CurrentPageTotal is the total number of items in current page CurrentPageTotal int // Total number of records. Default is the total number of rows. // Can be set to be greater than the total number of rows especially, if the list is paginated Total int // RepoName represents the name of the project or repository RepoName string // ListActionType should be either "search" or "list". Default is list ListActionType string // Optional. EmptyMessage to display when List is empty. If not provided, default one constructed from list Name. EmptyMessage string }
func NewListTitle ¶
func NewListTitle(listName string) ListTitleOptions
func (*ListTitleOptions) Describe ¶
func (opts *ListTitleOptions) Describe() string
type MarkdownRenderOpts ¶
type MarkdownRenderOpts []glamour.TermRendererOption