app

package
v0.0.0-...-e477a49 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DebugStatic    bool
	Version        bool
	LogPath        string
	DebugHostFile  bool   // 使用默认Debug文件
	FinalHostFile  string // 入参指定hosts文件
	MainPath       string
	ChangeFileHook string
	SupportMode    string
	Port           int
	PortStr        string
)
View Source
var Info = cuibase.HelpInfo{
	Description:   "Hosts Group, switch host tool",
	Version:       "1.4.2",
	SingleFlagLen: -2,
	DoubleFlagLen: 0,
	ValueLen:      -5,
	Flags: []cuibase.ParamVO{
		{Short: "-h", Comment: "help info"},
		{Short: "-f", Comment: "set main hosts file"},
		{Short: "-m", Comment: "main config file"},
		{Short: "-mode", Comment: "support mode: hosts,nginx"},
		{Short: "-cmd", Comment: "the cmd run after generate hosts file"},
		{Short: "-d", Comment: "debug mode, use test dir and host-file"},
		{Short: "-D", Comment: "debug static mode, use static dir not embed packaged"},
		{Short: "-v", Comment: "version"},
	},
	Options: []cuibase.ParamVO{
		{Short: "-l", Value: "path", Comment: "log path"},
	},
}

Functions

func CopyFile

func CopyFile(srcFileName string, dstFileName string) (written int64, err error)

func CreateOrUpdateFile

func CreateOrUpdateFile(c *gin.Context)

func CurrentHosts

func CurrentHosts(c *gin.Context)

func FileContent

func FileContent(c *gin.Context)

func InitConfigBuildEnv

func InitConfigBuildEnv()

初始化日志配置,目标hosts文件,应用配置目录

func ListFile

func ListFile(c *gin.Context)

func OnExit

func OnExit()

func OnReady

func OnReady()

func QueryMode

func QueryMode(c *gin.Context)

func SwitchFileState

func SwitchFileState(c *gin.Context)

func WebServer

func WebServer(f embed.FS, port string)

Types

type FileItemVO

type FileItemVO struct {
	Name    string `json:"name"`
	Use     bool   `json:"use"`
	Content string `json:"content,omitempty"`
}

Jump to

Keyboard shortcuts

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