server

package
v0.0.0-...-8e51596 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServerCmd = &cobra.Command{
	Use:   "server",
	Short: "Start a Popple server",
	RunE: func(cmd *cobra.Command, args []string) error {
		conf.InitConfig(conf.SetEnv(), conf.SetConfigFile(conf.GetString("config")))
		if conf.GetBool("dev") {
			log.Print("DevMode: ", conf.GetBool("dev"), conf.GetString("config"))
		}
		ready := make(chan struct{})
		server := raft.NewServer(conf.GetInt64("sid"), conf.GetString("cluster"), ready)
		go func() {
			server.WaitConnectToPeers()
			close(ready)
		}()
		server.Serve()

		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