tui

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MARGIN           = 2
	PADDING          = 1
	COLOR_PINK       = lipgloss.Color("#E95678")
	COLOR_PINK_2     = lipgloss.Color("#bd5970")
	COLOR_GRAY_1     = lipgloss.Color("#E3E4DB")
	COLOR_GRAY_2     = lipgloss.Color("#CDCDCD")
	COLOR_GRAY_3     = lipgloss.Color("#B8BABA")
	COLOR_GRAY_4     = lipgloss.Color("#626262")
	COLOR_DARK_GREEN = lipgloss.Color("#57886C")
	SOPHISTICATED    = lipgloss.Color("#abb2bf")
)

Variables

View Source
var (
	DocStyle = lipgloss.NewStyle().Margin(0, 2)
)
View Source
var (
	// WindowSize store the size of the terminal window
	WindowSize tea.WindowSizeMsg
)

Functions

func CalculateDaysLeft added in v0.1.2

func CalculateDaysLeft(expiry time.Time) int

CalculateDaysLeft returns the number of days left until expiry

func CreateConfig

func CreateConfig(configFolder, configFile string) error

CreateConfig creates a config file with dummy content

func Delete

func Delete[T any](l []T, i int) []T

Delete removes the element at index i from slice l returns the modified slice

func DeleteFromConfig

func DeleteFromConfig(domain, path string) error

DeleteDomain remove domain from config file

func DialDomains

func DialDomains(ssls *[]ssl, domains []string)

dial domains and return ssl info

func ExtractField

func ExtractField(ssls []ssl, f string) []string

ExtractField returns a slice of values for a given field

func ExtractHost

func ExtractHost(rawUrl string) string

ExtractHost returns the host from a given url

func FileExists

func FileExists(path string) bool

FileExists checks if a file exists at the given path

func Find

func Find[T comparable](l []T, v T) int

Find returns the index of the first instance of value in slice or -1 if value is not present in slice

func GetConfigPath

func GetConfigPath(folder, file string) string

GetConfigPath returns the path to the config file

func GetInfo

func GetInfo(domain string, ch chan chDailRes)

GetInfo returns the ssl info for a given domain

func GetSavedDomains

func GetSavedDomains(path string) ([]string, error)

func InitEntry

func InitEntry(ssls []ssl) *entry

func InitProject

func InitProject(st State) (tea.Model, tea.Cmd)

func RenderDaysLeft added in v0.1.2

func RenderDaysLeft(daysLeft int) string

func Sanitize

func Sanitize(raw string) string

Sanitize removes spaces and converts to lowercase

func SaveDomain

func SaveDomain(domain, path string) error

SaveDomain saves a new domain to the config file.

Types

type State

type State struct {
	ShouldRedail bool
	// contains filtered or unexported fields
}

state data shared that are passed back to initProject

Jump to

Keyboard shortcuts

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