util

package
v0.0.0-...-f27254a Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const Faves = "favorites"

constants

View Source
const SeeYa = "👋 See ya"

Variables

View Source
var ConfigPath string
View Source
var FavesPath string

paths

View Source
var PathsPath string

Functions

func Exit

func Exit(msg interface{})

func GetFavorites

func GetFavorites(path string) (map[string]interface{}, error)

func LoadFavorites

func LoadFavorites(path string) (map[string]Favorite, error)

func LoadPaths

func LoadPaths(path string) (map[string]interface{}, error)

func MaybeExit

func MaybeExit(msg interface{})

func OpenURL

func OpenURL(url string, conf *Config) error

func UpdateFavorites

func UpdateFavorites(path string, keys []string, newest string) error

Types

type Config

type Config struct {
	BrowserCommand     []string `json:"BrowserCommand,omitempty"`
	BinaryDirName      string   `json:"BinaryDirName,omitempty"`
	DirectoriesDirName string   `json:"DirectoriesDirName,omitempty"`
}

func LoadConfig

func LoadConfig(path string) (*Config, error)

type Favorite

type Favorite struct {
	Count   int
	Url     string
	LastUse int64
}

type Mode

type Mode = int
const (
	None Mode = iota
	Website
	Directory
	Binary
	Quit
)

func Choose

func Choose(all_paths map[string]interface{}, choices map[string]interface{}, conf *Config, previous_keys []string, mode Mode) (string, Mode, error)

Jump to

Keyboard shortcuts

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