Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MatchFiles ¶
MatchFiles is a function that takes a list of globs and returns array of FileInfo
ex: files := MatchFiles([]string{"test/*.go", "test/wwwroot/*"})
Types ¶
type Build ¶
type Build struct {
Name string `json:"name,omitzero"`
Description string `json:"description,omitzero"`
Match []string `json:"match,omitzero"`
HeartBeat time.Duration `json:"heartBeat,omitzero"`
BuildCmd string `json:"buildCmd,omitzero"`
BuildArgs []string `json:"buildArgs,omitzero"`
BuildEnv []string `json:"buildEnv,omitzero"`
BuildDir string `json:"buildDir,omitzero"`
RunCmd string `json:"runCmd,omitzero"`
RunArgs []string `json:"runArgs,omitzero"`
RunEnv []string `json:"runEnv,omitzero"`
RunDir string `json:"runDir,omitzero"`
}
Build is a struct that represents a build and run process
func (*Build) Build ¶
Build executes the configured buildCmd with buildArgs and buildEnv variables.
ex: err := b.Build()
func (*Build) Run ¶
Run executes the configured runCmd with runArgs and runEnv variables.
ex: b.Run(ctx)
func (*Build) Start ¶
Start manages the build and run processes
Calling cancel on the parent context will stop the build and run processes; otherwise the restart channel will trigger a rebuild and rerun. If a build fails, the routine halts until it receives a signal from the restart channel.
ex: b.Start(parentContext)
type Config ¶
type Config struct {
// Name and Description are used internally
Name string `json:"name"`
Description string `json:"description"`
// Builds is a list of Build structs
Builds []Build `json:"builds"`
// ReverseProxy is a map of paths to HttpTarget
// ex: "/api" -> HttpTarget{Host: "http://localhost:8080"}
ReverseProxy map[string]HttpTarget `json:"reverseProxy"`
// Address is the IP and port to bind the server to
Bind string `json:"bind,omitzero"`
// TLSCertFile is the relative path to the TLS certificate file for the server
TLSCertFile string `json:"tlsCertFile,omitzero"`
// TLSKeyFile is the relative path to the TLS key file for the server
TLSKeyFile string `json:"tlsKeyFile,omitzero"`
}
type HttpTarget ¶
type HttpTarget struct {
// Host is the URL of the target
// ex: "http://localhost:8080"
Host string `json:"host"`
// CustomHeaders is a map of headers to add to the request
// ex: {"Speak-Friend": "mellon"}
CustomHeaders map[string]string `json:"customHeaders,omitzero"`
// InsecureSkipVerify is a flag to enable or disable TLS verification downstream
InsecureSkipVerify bool `json:"insecureSkipVerify,omitzero"`
}
HttpTarget is a reverse proxy target