feat: significant overhaul of runtime

This commit is contained in:
Lea Anthony
2019-07-20 19:32:30 +10:00
parent d2f114e44e
commit 030e911ea4
58 changed files with 759 additions and 291 deletions

21
runtime/browser.go Normal file
View File

@@ -0,0 +1,21 @@
package runtime
import "github.com/pkg/browser"
// Browser exposes browser methods to the runtime
type Browser struct{}
// NewBrowser creates a new runtime Browser struct
func NewBrowser() *Browser {
return &Browser{}
}
// OpenURL opens the given url in the system's default browser
func (r *Browser) OpenURL(url string) error {
return browser.OpenURL(url)
}
// OpenFile opens the given file in the system's default browser
func (r *Browser) OpenFile(filePath string) error {
return browser.OpenFile(filePath)
}