console

package
v0.0.1-20220809-0006 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StartBrokerServer = &command.AddCmd{
	GeneratePID: false,
	LockProcess: false,
	ProcessName: "broker",

	EnableStartupServices: true,
	StartupCoreServices: command.StartupCoreServices{
		BrokerClients: true,
	},
	OnGetProcessName: func(cmd *command.AddCmd) string {
		brokerName := getInstanceName(cmd.Args)
		return cmd.ProcessName + "_" + brokerName
	},
	Cmd:  "broker:start",
	Name: "Start - Broker Server",
	OnExecute: func(cmd *command.AddCmd) {
		brokerName := getInstanceName(cmd.Args)
		brk, err := broker.GetBroker(_context.GetDefaultContext(), brokerName)
		if err != nil {
			log.Fatalln("failed to generate broker...", err)
		}

		err = brk.Start()
		if err != nil {
			log.Fatalln("failed to start broker...", err)
		}
		for {
			time.Sleep(time.Second)
		}
	},
	OnCreate: func(cmd *command.AddCmd) {
		cmd.Command.Args = cobra.MaximumNArgs(1)
	},
}
View Source
var StopBrokerServer = &command.AddCmd{
	OnExecute: func(cmd *command.AddCmd) {
		cmd.StopProcess()
	},
	OnGetProcessName: func(cmd *command.AddCmd) string {
		brokerName := getInstanceName(cmd.Args)
		return cmd.ProcessName + "_" + brokerName
	},
	OnCreate: func(cmd *command.AddCmd) {
		cmd.Command.Args = cobra.MaximumNArgs(1)
	},
	ProcessName: "broker",
	Cmd:         "broker:stop",
	Name:        "Stop - Broker Server",
}

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