reload

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Command launches the deamon subcommand.
	Command = &cobra.Command{
		Use:   "reload",
		Short: "Realod Shigoto service",
		Args:  cobra.NoArgs,
		RunE: func(c *cobra.Command, _ []string) (err error) {
			if cfg == "" {
				cfg, err = config.Lookup(config.Filenames...)
				if err != nil {
					if err == os.ErrNotExist {
						return errors.New("no configuration found from the default pathes")
					}
					return err
				}
			}

			konf := koanf.New(".")
			if err := konf.Load(file.Provider(cfg), toml.Parser()); err != nil {
				return err
			}

			payload, err := socket.New(konf.String("socket")).Request(socket.SignalReload)
			if err != nil {
				return err
			}
			fmt.Println(string(payload))
			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