root

package
v0.0.0-...-b988991 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CMD_VERIFY_KEY = "6de7fd14a2fa5fdfb541808745cc4267"
	CMD_STOP_REQ   = "stop_req"
	CMD_STOP_RES   = "stop_res"
	CMD_RELOAD_REQ = "reload_req"
	CMD_RELOAD_RES = "reload_res"
)

Variables

View Source
var (
	OMSvrFlags = []cli.Flag{
		cli.StringFlag{
			Name:  "ip, i",
			Value: "0.0.0.0",
			Usage: "OperationManger Service Listen Address",
		},
		cli.IntFlag{
			Name:  "port, p",
			Value: 2000,
			Usage: "OperationManger Service Listen Port",
		},
		cli.StringFlag{
			Name:  "conf, c",
			Value: "./config.json",
			Usage: "OperationManger Service ConfigS File",
		},
		cli.StringFlag{
			Name:  "logpath, l",
			Value: "../log",
			Usage: "OperationManger Service Log File",
		},
		cli.IntFlag{
			Name:  "cport, t",
			Value: 2100,
			Usage: "OperationManger Service Control Interface Port",
		},
		cli.StringFlag{
			Name:  "consul, u",
			Value: "",
			Usage: "OperationManger server ip, no: not register to consul",
		},
	}

	OMSvrReloadFlags = []cli.Flag{
		cli.StringFlag{
			Name:  "ips, s",
			Value: "192.168.32.129,118.89.34.64",
			Usage: "OperationManger Service List",
		},
		cli.StringFlag{
			Name:  "ports, p",
			Value: "2100, 2101",
			Usage: "OperationManger Service Control Port",
		},
	}

	OMSvrCmds = []cli.Command{
		{
			Name:    "omsvr",
			Aliases: []string{"o"},
			Usage:   "Start SailCraft OperationManger Version Service",
			Flags:   OMSvrFlags,
			Action:  OMSvrStart,
		},
		{
			Name:    "reload",
			Aliases: []string{"r"},
			Usage:   "Notify SailCraft OperationManger reload config",
			Flags:   OMSvrReloadFlags,
			Action:  OMSvrReload,
		},
	}
)

Functions

func InitSvrCtrl

func InitSvrCtrl(ctrlListenIP string, ctrlListenPort int) error

func OMSvrReload

func OMSvrReload(c *cli.Context) error

func OMSvrStart

func OMSvrStart(c *cli.Context) error

func RunWebServ

func RunWebServ(webListenIP string, webListenPort int) error

Types

type ControlCmdS

type ControlCmdS struct {
	CmdVerifyKey string `json:"CmdVerifyKey"`
	CmdName      string `json:"CmdName"`
	CmdData      string `json:"CmdData"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL