url

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FIREFOX_CONTAINER_FORMAT = "ext+container:name=%s&url=%s&color=%s&icon=%s"
	GRANTED_CONTAINER_FORMAT = "ext+granted-containers:name=%s&url=%s&color=%s&icon=%s"
	DEFAULT_PRE_MSG          = "Please open the following URL in your browser:\n\n"
	DEFAULT_POST_MSG         = "\n\n"
)
View Source
const (
	Undef            Action = ""         // undefined
	Clip             Action = "clip"     // copy to clipboard
	Print            Action = "print"    // print message & url to stderr
	PrintUrl         Action = "printurl" // print only the  url to stderr
	Exec                    = "exec"     // Exec comand
	Open                    = "open"     // auto-open in default or specified browser
	GrantedContainer        = "granted-containers"
	OpenUrlContainer        = "open-url-in-container"
)
View Source
const (
	ConfigProfilesUndef            ConfigProfilesAction = ""     // undefined
	ConfigProfilesClip             ConfigProfilesAction = "clip" // copy to clipboard
	ConfigProfilesExec                                  = "exec" // Exec comand
	ConfigProfilesOpen                                  = "open" // auto-open in default or specified browser
	ConfigProfilesGrantedContainer                      = "granted-containers"
	ConfigProfilesOpenUrlContainer                      = "open-url-in-container"
)

Variables

View Source
var FIREFOX_PLUGIN_COLORS []string = []string{
	"blue",
	"turquoise",
	"green",
	"yellow",
	"orange",
	"red",
	"pink",
	"purple",
}

taken from https://github.com/honsiorovskyi/open-url-in-container/blob/1.0.3/launcher.sh

View Source
var FIREFOX_PLUGIN_ICONS []string = []string{
	"fingerprint",
	"briefcase",
	"dollar",
	"cart",
	"gift",
	"vacation",
	"food",
	"fruit",
	"pet",
	"tree",
	"chill",
	"circle",
}

Functions

func GetLogger

func GetLogger() *logrus.Logger

func SetLogger

func SetLogger(l *logrus.Logger)

Types

type Action

type Action string

func NewAction

func NewAction(action string) (Action, error)

func (Action) IsContainer

func (u Action) IsContainer() bool

type ConfigProfilesAction

type ConfigProfilesAction string

func NewConfigProfilesAction

func NewConfigProfilesAction(action string) (ConfigProfilesAction, error)

func (ConfigProfilesAction) IsContainer

func (u ConfigProfilesAction) IsContainer() bool

type HandleUrl

type HandleUrl struct {
	Action        Action
	ExecCmd       []string
	Browser       string
	Url           string
	PreMsg        string
	PostMsg       string
	ContainerName string
	Color         string
	Icon          string
}

func NewHandleUrl

func NewHandleUrl(action Action, url, browser string, command []string) *HandleUrl

func (*HandleUrl) ContainerSettings

func (h *HandleUrl) ContainerSettings(name, color, icon string)

ContainerSettings updates our config with the options necessary to open in a container

func (*HandleUrl) Open

func (h *HandleUrl) Open() error

Open our url using our config

Jump to

Keyboard shortcuts

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