Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ClientCmd = &cli.Command{ Name: "client", Description: "run client to demonstrate registering an IP for the lifecycle of a program", Action: runClient, Flags: []cli.Flag{ portFlag, &cli.StringFlag{ Name: "subdomain", Aliases: []string{"d"}, Usage: "subdomain name", Destination: &subdomain, Required: true, }, }, }
View Source
var ( DockerCmd = &cli.Command{ Name: "docker", Description: "register a docker container with a subdomain", Action: runRegisterDocker, Flags: []cli.Flag{ portFlag, &cli.StringFlag{ Name: "subdomain", Aliases: []string{"d"}, Usage: "subdomain name", DefaultText: "docker container name (if using --container/-c)", Destination: &subdomain, }, &cli.StringFlag{ Name: "container", Aliases: []string{"c"}, Usage: "name of a docker container running locally", Destination: &dockerContainer, Required: true, }, &cli.StringFlag{ Name: "socket", Usage: "path to the docker socket", Destination: &dockerSocket, Value: defaultDockerSocket, Sources: cli.ValueSourceChain{Chain: []cli.ValueSource{dockerSocketEnvVar}}, }, }, } )
View Source
var ExampleCmd = &cli.Command{
Name: "example",
Description: "run example to demonstrate. This will run the server, start a few example plugins, and then shutdown",
Action: runExample,
}
View Source
var ( RegisterCmd = &cli.Command{ Name: "register", Description: "register a fallback route with the server", Action: runRegister, Flags: []cli.Flag{ portFlag, &cli.StringFlag{ Name: "subdomain", Aliases: []string{"d"}, Usage: "subdomain name", Destination: &subdomain, Required: true, }, &cli.StringFlag{ Name: "address", Aliases: []string{"a"}, Usage: "fallback address to route to", Destination: &address, Required: true, }, }, } )
View Source
var ( RunCmd = &cli.Command{ Name: "run", Description: "build and run a plugin", Action: runPluginCmd, Flags: []cli.Flag{ &cli.StringFlag{ Name: "plugin", Aliases: []string{"p"}, Required: true, TakesFile: true, Usage: "filename for *.so plugin or directory for building it", Destination: &pluginFilename, Validator: func(v string) error { if filepath.Ext(v) == ".so" { return nil } stat, err := os.Stat(v) if err != nil { return err } if !stat.IsDir() { return errors.New("plugin must be .so file or directory to build from") } isDir = true return nil }, }, &cli.StringFlag{ Name: "subdomain", Aliases: []string{"d"}, Usage: "subdomain name", DefaultText: "plugin filename (without .so)", Destination: &subdomain, }, &cli.StringFlag{ Name: "env", Aliases: []string{"e"}, Usage: "environment variable to communicate IP. Goblin will set this env var" + " with the allocated IP and run your application's main() function", Destination: &ipEnvVar, }, portFlag, }, } )
View Source
var ( ServerCmd = &cli.Command{ Name: "server", Description: "run server", Action: runServer, Flags: []cli.Flag{ &cli.StringFlag{ Name: "domain", Aliases: []string{"d"}, Value: "goblin", Usage: "top-level domain name to use", Destination: &topLevelDomain, }, portFlag, &cli.StringFlag{ Name: "dns-port", Aliases: []string{"s"}, Value: defaultDNSPort, Usage: "port to run the DNS server on", Destination: &dnsPort, }, &cli.StringFlag{ Name: "fallback-routes", Aliases: []string{"r"}, TakesFile: true, Validator: func(v string) error { if filepath.Ext(v) != ".json" { return errors.New("fallback-routes must be JSON file") } return nil }, Usage: `path to a JSON file holding fallback route config in this format: { "subdomain": "remote-server.com" }`, Destination: &fallbackConfig, }, }, } )
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.