open

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2018 License: BSD-3-Clause Imports: 7 Imported by: 1

README

go-open

CircleCI Appveyor codecov.io godoc.org Releases GA

Package open implements a cross-platform supported opens stuff like websites, files, directory or executables.

Documentation

Overview

Package open implements a cross-platform supported opens stuff like websites, files, directory or executables.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(ctx context.Context, input string, opts ...Option) (*exec.Cmd, error)

Command returns the cross-platform supported exec.Command.

func Run

func Run(input string, opts ...Option) error

Run opens the URI, files, directory or executables using the GOOS default application. Wait for the open command to complete.

func RunContext

func RunContext(ctx context.Context, input string, opts ...Option) error

RunContext opens the URI, files, directory or executables using the GOOS default application with context support. Wait for the open command to complete.

func Start

func Start(input string, opts ...Option) (func() error, error)

Start opens the URI, files, directory or executables using the GOOS default application. Don't wait for the open command to complete.

func StartContext

func StartContext(ctx context.Context, input string, opts ...Option) (func() error, error)

StartContext opens the URI, files, directory or executables using the GOOS default application with context support. Don't wait for the open command to complete.

Types

type Option

type Option func(*options)

Option represents a functional pattern option type for options.

func WithApplication

func WithApplication(app string) Option

WithApplication sets the open with specific application to open command.

func WithArgs

func WithArgs(args []string) Option

WithArgs sets the any arguments to open command.

func WithDir

func WithDir(dir string) Option

WithDir sets the directory to open command.

func WithEnv

func WithEnv(env []string) Option

WithEnv sets the environment variables to open command.

func WithWait

func WithWait() Option

WithWait wait for the open command to complete.

Jump to

Keyboard shortcuts

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