client

package
v0.0.0-...-252d4e6 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = cli.Command{
	Name:  "client",
	Usage: "Request the Words of Wisdom",
	Flags: []cli.Flag{
		cli.StringFlag{
			Name:        "url",
			Usage:       "Target URL.",
			EnvVar:      "POW_CLIENT_URL",
			Value:       "http://localhost:12000/words",
			Destination: &config.URL,
		},
		cli.BoolFlag{
			Name:   "endless",
			Usage:  "Run requests endless.",
			EnvVar: "POW_CLIENT_ENDLESS",
		},
	},
	Action: func(c *cli.Context) error {
		curl := c.String("url")
		_, err := url.ParseRequestURI(curl)
		if err != nil {
			return err
		}

		if c.Bool("endless") {
			return app.Endless(curl)
		}

		return app.OneRequest(curl)
	},
}

Runs a client part of application

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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