opentofu/internal/command/webbrowser/webbrowser.go
Martin Atkins ffe056bacb Move command/ to internal/command/
This is part of a general effort to move all of Terraform's non-library
package surface under internal in order to reinforce that these are for
internal use within Terraform only.

If you were previously importing packages under this prefix into an
external codebase, you could pin to an earlier release tag as an interim
solution until you've make a plan to achieve the same functionality some
other way.
2021-05-17 14:09:07 -07:00

20 lines
876 B
Go

package webbrowser
// Launcher is an object that knows how to open a given URL in a new tab in
// some suitable browser on the current system.
//
// Launching of browsers is a very target-platform-sensitive activity, so
// this interface serves as an abstraction over many possible implementations
// which can be selected based on what is appropriate for a specific situation.
type Launcher interface {
// OpenURL opens the given URL in a web browser.
//
// Depending on the circumstances and on the target platform, this may or
// may not cause the browser to take input focus. Because of this
// uncertainty, any caller of this method must be sure to include some
// language in its UI output to let the user know that a browser tab has
// opened somewhere, so that they can go and find it if the focus didn't
// switch automatically.
OpenURL(url string) error
}