utils

package
v0.0.0-...-a11563c Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmojiMap = map[string]Emoji{}/* 1854 elements not displayed */

Functions

func CheckIfError

func CheckIfError(err error)

func CheckIfInterrupt

func CheckIfInterrupt(err error)

func ConvertToHex

func ConvertToHex(emoji string) string

func DurationConverter

func DurationConverter(period int, duration string) (int, string)

DurationConverter takes period and duration for a status and converts it into minutes also returns absolute duration for showing on help messages

func EmojiKeys

func EmojiKeys() []string

func HandleNoProfiles

func HandleNoProfiles()

Types

type Emoji

type Emoji struct {
	Name    string
	Unicode string
	Alias   string
}

type ParsedDuration

type ParsedDuration struct {
	UserDefinedDuration string
	AbsolutePeriod      int
}

func ParseDuration

func ParseDuration(duration string) ParsedDuration

Parses user duration for minute, hour, and day. Defaults to minutes.

@CONDITIONS minutes cannot be more than 43800 hours cannot be more than 730 day cannot be more than 30

@REGEX:

(?P<Name>pattern) = match group
^\d+ = starts with any digits with one or more matches
\s? = optional whitespace characters
---
-- Matches for duration suffix
(m$|min$|minutes?|h$|hr$|hours?|d$|days?)?
$ = match with character/word ending before the symbol
| = OR

Jump to

Keyboard shortcuts

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