github.com/terramate-io/tf@v0.0.0-20230830114523-fce866b4dfcd/command/webbrowser/webbrowser.go (about) 1 // Copyright (c) HashiCorp, Inc. 2 // SPDX-License-Identifier: MPL-2.0 3 4 package webbrowser 5 6 // Launcher is an object that knows how to open a given URL in a new tab in 7 // some suitable browser on the current system. 8 // 9 // Launching of browsers is a very target-platform-sensitive activity, so 10 // this interface serves as an abstraction over many possible implementations 11 // which can be selected based on what is appropriate for a specific situation. 12 type Launcher interface { 13 // OpenURL opens the given URL in a web browser. 14 // 15 // Depending on the circumstances and on the target platform, this may or 16 // may not cause the browser to take input focus. Because of this 17 // uncertainty, any caller of this method must be sure to include some 18 // language in its UI output to let the user know that a browser tab has 19 // opened somewhere, so that they can go and find it if the focus didn't 20 // switch automatically. 21 OpenURL(url string) error 22 }