url

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 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 AWS_FEDERATED_URL_FORMAT = "https://%s.signin.%s/federation"

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 AWSConsoleUrl added in v1.14.2

func AWSConsoleUrl(ssoRegion, region string) string

AWSConsoleUrl generates the partition specific URL for the AWS Console

func AWSFederatedUrl added in v1.14.2

func AWSFederatedUrl(ssoRegion string) string

AWSFederatedUrl generates the region/partition specific URL for the AWS Federated endpoint for IAM Identity Center https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html

func GetLogger

func GetLogger() *logrus.Logger

func SetLogger

func SetLogger(l *logrus.Logger)

Types

type Action

type Action string
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             Action = "exec"     // Exec comand
	Open             Action = "open"     // auto-open in default or specified browser
	GrantedContainer Action = "granted-containers"
	OpenUrlContainer Action = "open-url-in-container"
)

func NewAction

func NewAction(action string) (Action, error)

func SSOAuthAction added in v1.10.0

func SSOAuthAction(action Action) Action

SSOAuthAction returns the action except in the case where it might use a container, in that case it returns a straight Open. This is so that URLs used to do AWS SSO auth use the primary browser session to avoid re-auth

func (Action) IsContainer

func (u Action) IsContainer() bool

type ConfigProfilesAction

type ConfigProfilesAction string
const (
	ConfigProfilesUndef            ConfigProfilesAction = ""     // undefined
	ConfigProfilesClip             ConfigProfilesAction = "clip" // copy to clipboard
	ConfigProfilesExec             ConfigProfilesAction = "exec" // Exec comand
	ConfigProfilesOpen             ConfigProfilesAction = "open" // auto-open in default or specified browser
	ConfigProfilesGrantedContainer ConfigProfilesAction = "granted-containers"
	ConfigProfilesOpenUrlContainer ConfigProfilesAction = "open-url-in-container"
)

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