cmdutil

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DateLayout          = "2006-01-02"
	DateTimeLayout      = "2006-01-02 15:04:05"
	ShortDateLayout     = "20060102"
	ShortDateTimeLayout = "20060102150405"
)

Supported datetime layouts.

Variables

View Source
var (
	// ErrInvlalidTimezone is returned if timezone is not in a valid IANA timezone format.
	ErrInvlalidTimezone = fmt.Errorf("timezone should be a valid IANA timezone, eg: Asia/Kathmandu, Europe/Berlin etc")
	// ErrorInvalidDateTime is returned when datetime string is invalid.
	ErrorInvalidDateTime = fmt.Errorf("datetime string should be in a valid format, eg: 2022-01-02 10:10:05 or 2022-01-02")
)

Functions

func DateStringToJiraFormatInLocation added in v1.2.0

func DateStringToJiraFormatInLocation(value string, timezone string) (string, error)

DateStringToJiraFormatInLocation parses a standard string to jira compatible RFC3339 datetime format.

func ExitIfError

func ExitIfError(err error)

ExitIfError exists with error message if err is not nil.

func Fail

func Fail(msg string, args ...interface{})

Fail prints failure message in stderr.

func Failed

func Failed(msg string, args ...interface{})

Failed prints failure message in stderr and exits.

func FormatDateTimeHuman

func FormatDateTimeHuman(dt, format string) string

FormatDateTimeHuman formats date time in human readable format.

func GenerateServerBrowseURL added in v1.4.0

func GenerateServerBrowseURL(server, key string) string

GenerateServerBrowseURL will return the `browse` URL for a given key. The server section can be overridden via `browse_server` in config. This is useful if your API endpoint is separate from the web client endpoint.

func GetConfigHome

func GetConfigHome() (string, error)

GetConfigHome returns the config home directory.

func GetJiraIssueKey

func GetJiraIssueKey(project, key string) string

GetJiraIssueKey constructs actual issue key based on given key.

func GetSubtaskHandle added in v1.0.0

func GetSubtaskHandle(issueType string, issueTypes []*jira.IssueType) string

GetSubtaskHandle fetches actual subtask handle. This value can either be handle or name based on the used jira version.

func GetTUIStyleConfig added in v1.1.0

func GetTUIStyleConfig() tui.TableStyle

GetTUIStyleConfig returns the custom style configured by the user.

func Info

func Info(msg string) *spinner.Spinner

Info displays spinner.

func Navigate(server, path string) error

Navigate navigates to jira issue.

func NormalizeJiraError added in v0.2.0

func NormalizeJiraError(msg string) string

NormalizeJiraError normalizes error message we receive from jira.

func ReadFile

func ReadFile(filePath string) ([]byte, error)

ReadFile reads contents of the given file.

func StdinHasData

func StdinHasData() bool

StdinHasData checks if standard input has any data to be processed.

func Success

func Success(msg string, args ...interface{})

Success prints success message in stdout.

func Warn added in v1.0.0

func Warn(msg string, args ...interface{})

Warn prints warning message in stderr.

Types

This section is empty.

Jump to

Keyboard shortcuts

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