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: 14 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 (
	GuideSvrFlags = []cli.Flag{
		cli.StringFlag{
			Name:  "ip, i",
			Value: "0.0.0.0",
			Usage: "Guide Service Listen Address",
		},
		cli.IntFlag{
			Name:  "port, p",
			Value: 8000,
			Usage: "Guide Service Listen Port",
		},
		cli.StringFlag{
			Name:  "conf, c",
			Value: "./config.json",
			Usage: "Guide Service ConfigS File",
		},
		cli.StringFlag{
			Name:  "logpath, l",
			Value: "../log",
			Usage: "Guide Service Log File",
		},
		cli.IntFlag{
			Name:  "cport, t",
			Value: 8100,
			Usage: "Guide Service Control Interface Port",
		},
		cli.StringFlag{
			Name:  "consul, u",
			Value: "",
			Usage: "Guide server ip",
		},
	}

	GuideSvrReloadFlags = []cli.Flag{
		cli.StringFlag{
			Name:  "ips, s",
			Value: "192.168.32.129,118.89.34.64",
			Usage: "Guide Service List",
		},
		cli.StringFlag{
			Name:  "ports, p",
			Value: "10001, 10002, 10003",
			Usage: "Guide Service Control Port",
		},
	}

	GuideSvrCmds = []cli.Command{
		{
			Name:    "guide",
			Aliases: []string{"o"},
			Usage:   "Start SailCraft Guide Version Service",
			Flags:   GuideSvrFlags,
			Action:  GuideSvrStart,
		},
		{
			Name:    "reload",
			Aliases: []string{"r"},
			Usage:   "Notify SailCraft Guide reload config",
			Flags:   GuideSvrReloadFlags,
			Action:  GuideSvrReload,
		},
	}
)

Functions

func GuideSvrReload

func GuideSvrReload(c *cli.Context) error

func GuideSvrStart

func GuideSvrStart(c *cli.Context) error

func InitSvrCtrl

func InitSvrCtrl(ctrlListenIP string, ctrlListenPort int) 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