Documentation ¶
Index ¶
- func GetFreePort(port int) (int, error)
- type AngularDevProxyOptions
- type ReactDevProxyOptions
- type RunnerType
- type SpaDevProxy
- func NewAngularDevProxy(options *AngularDevProxyOptions) (SpaDevProxy, error)
- func NewReactDevProxy(options *ReactDevProxyOptions) (SpaDevProxy, error)
- func NewSpaDevProxy(options *SpaDevProxyOptions) (SpaDevProxy, error)
- func NewSvelteDevProxy(options *SvelteDevProxyOptions) (SpaDevProxy, error)
- func NewVueDevProxy(options *VueDevProxyOptions) (SpaDevProxy, error)
- type SpaDevProxyOptions
- type SvelteDevProxyOptions
- type VueDevProxyOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFreePort ¶
GetFreePort checks and returns free port if specified port is privildeged port or zero
Types ¶
type AngularDevProxyOptions ¶
type AngularDevProxyOptions struct { RunnerType RunnerType ScriptName string Dir string Port int Production bool }
AngularDevProxyOptions represents Angular development proxy options.
type ReactDevProxyOptions ¶
type ReactDevProxyOptions struct { RunnerType RunnerType ShowBuildInfo bool ScriptName string Dir string Port int }
ReactDevProxyOptions represents React development proxy options.
type RunnerType ¶
type RunnerType int
RunnerType runner type.
const ( // RunnerTypeNpm runner type NPM. RunnerTypeNpm RunnerType = iota // RunnerTypeNpx runner type NPX. RunnerTypeNpx //RunnerTypeYarn runner type Yarn. RunnerTypeYarn // RunnerTypeCustom custom runner type. RunnerTypeCustom )
type SpaDevProxy ¶
type SpaDevProxy interface { // Start backgroud process and wait when it is ready to accept connections. Start(ctx context.Context) error // Stop background process by killing it. Stop() error // DevServerURL returns development server URL. DevServerURL() *url.URL // HandleFunc handles reverse proxy function. HandleFunc(w http.ResponseWriter, r *http.Request) }
SpaDevProxy instance.
func NewAngularDevProxy ¶
func NewAngularDevProxy(options *AngularDevProxyOptions) (SpaDevProxy, error)
NewAngularDevProxy returns new SpaDevProxy instance for Angular development.
func NewReactDevProxy ¶
func NewReactDevProxy(options *ReactDevProxyOptions) (SpaDevProxy, error)
NewReactDevProxy returns new SpaDevProxy instance for React development.
func NewSpaDevProxy ¶
func NewSpaDevProxy(options *SpaDevProxyOptions) (SpaDevProxy, error)
NewSpaDevProxy creates new SpaDevProxy instance.
func NewSvelteDevProxy ¶
func NewSvelteDevProxy(options *SvelteDevProxyOptions) (SpaDevProxy, error)
NewSvelteDevProxy returns new SpaDevProxy instance for SvelteJS development.
func NewVueDevProxy ¶
func NewVueDevProxy(options *VueDevProxyOptions) (SpaDevProxy, error)
NewVueDevProxy returns new SpaDevProxy instance for VueJS development.
type SpaDevProxyOptions ¶
type SpaDevProxyOptions struct { // RunnerType to use. Defaults to NPM. RunnerType RunnerType // ScriptName is the name of the script to run. ScriptName string // Args holds command line arguments. Args []string // Env specifies the environment of the process. // Each entry is of the form "key=value". // If Env is nil, the new process uses the current process's // environment. // If Env contains duplicate environment keys, only the last // value in the slice for each duplicate key is used. // As a special case on Windows, SYSTEMROOT is always added if // missing and not explicitly set to the empty string. Env []string // Dir specifies the working directory of the command. // If Dir is the empty string, Start runs the command in the // calling process's current directory. Dir string // StartRegexp specifies regular expression used to detect // when background process is ready to accept incomming requests. StartRegexp *regexp.Regexp // Port specifies localhost port that background service is // using to accept requests. Port int // ShowBuildInfo specifies option either to show webpack building // progress or not. ShowBuildInfo bool }
SpaDevProxyOptions options to use for SpaDevProxy.
type SvelteDevProxyOptions ¶
type SvelteDevProxyOptions struct { RunnerType RunnerType ScriptName string Dir string Port int }
SvelteDevProxyOptions represents Svelte development proxy options.
type VueDevProxyOptions ¶
type VueDevProxyOptions struct { RunnerType RunnerType ScriptName string Dir string Port int Mode string }
VueDevProxyOptions represents VueJS development proxy options.