Documentation ¶
Overview ¶
Package app defines the Kisipar web server application.
Example ¶
package main import ( "log" "os" "path/filepath" "github.com/biztos/kisipar" "github.com/biztos/kisipar/app" ) func main() { // For testing purposes, let's not really launch the servers: kisipar.LAUNCH_SERVERS = false // ...and let's not do tricky logging: log.SetFlags(0) log.SetOutput(os.Stdout) // We conveniently have some test sites on disk we can use for this: path1 := filepath.Join("test_data", "site_1") path2 := filepath.Join("test_data", "site_2") // Imagining this usage: os.Args = []string{ "kisipar", // arg zero: the app path1, // arg one: the first site to launch path2, // arg two: the second site to launch } // This, our simple launcher, will launch those: err := app.Run("Kisipar Example", "1.0.0", "kisipar-example") if err != nil { log.Fatal(err) } }
Output: Test Site One: listening on port 8081. Test Site Two: listening on port 8082.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
Run runs the application with the standard options and the provided name, version, and binary name; and the default usage spec from Usage. The first error encountered is returned.
func main() { if err := kisipar.Run("Foobar Thingy","1.2.3","foobar"); err != nil log.Fatal(err) } log.Println("DONE.") }
Types ¶
type Options ¶
type Options struct {
SitePaths []string
}
Options represents the standard set of command-line options, which are parsed according to the usage specification provided to GetOpts.
Click to show internal directories.
Click to hide internal directories.