cmdstatus

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &command.C{
	Name: "status",
	Help: "Print the status of the storage server.",

	Run: command.Adapt(func(env *command.Env) error {
		cfg := env.Config.(*config.Settings)
		return cfg.WithStore(env.Context(), func(s config.CAS) error {
			cs, ok := s.Base().(chirpstore.CAS)
			if !ok {
				return errors.New("store does not support the status command")
			}
			data, err := cs.Status(env.Context())
			if err != nil {
				return err
			}
			fmt.Println(config.ToJSON(json.RawMessage(data)))
			return nil
		})
	}),
}

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