dbstats

package
v0.4.11 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cli.Command{
	Name:  "dbstats",
	Flags: []cli.Flag{},
	Action: func(c *cli.Context) (err error) {

		defer func() {
			if err != nil {
				err = cli.Exit(fmt.Errorf("while listing handlers: %w", err), 1)
			}
		}()

		serverBaseURL, err := serverurl.BaseServerURL("")
		if err != nil {
			return err
		}

		if serverBaseURL == "" {
			return errors.New("could not determine Kartusche server")
		}

		name := c.Args().First()

		if name == "" {
			return errors.New("name of kartusche must be provided")
		}

		dbs := &runtime.DBStats{}
		err = client.CallAPI(serverBaseURL, "GET", path.Join("kartusches", name, "info", "dbstats"), nil, nil, client.JSONDecoder(&dbs), 200)
		if err != nil {
			return fmt.Errorf("while starting login process: %w", err)
		}

		return yaml.NewEncoder(os.Stdout).Encode(dbs)

	},
}

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