utils

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorStyle = lipgloss.NewStyle().
	Bold(true).
	Foreground(lipgloss.Color("#FF0000"))
View Source
var SuccessStyle = lipgloss.NewStyle().
	Bold(true).
	Foreground(lipgloss.Color("#00FF00"))
View Source
var UrlRegex = regexp.MustCompile(`^https?:\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(:[0-9]+)?(\/.*)?$`)

Functions

func FormatDomain

func FormatDomain(domain string) (string, error)

func IsEmpty

func IsEmpty(str string) bool

func IsValidInstance

func IsValidInstance(url string) (bool, error)

func PrintErr

func PrintErr(str string) error

func PrintError

func PrintError(err error) error

Types

type ConfigResponse

type ConfigResponse struct {
	Status  int                `json:"status"`
	Message string             `json:"message"`
	Data    ConfigResponseData `json:"data"`
}

type ConfigResponseData

type ConfigResponseData struct {
	Instance            string                     `json:"instance"`
	Domain              string                     `json:"domain"`
	SSL                 bool                       `json:"ssl"`
	AuthorizeCustomCode bool                       `json:"authorize_custom_shortcode"`
	Expirations         []ConfigResponseExpiration `json:"expirations"`
}

func GetConfig

func GetConfig(url string) (ConfigResponseData, error)

type ConfigResponseExpiration

type ConfigResponseExpiration struct {
	Name    string `json:"name"`
	Minutes int    `json:"minutes"`
}

Jump to

Keyboard shortcuts

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