sys

package
v0.0.0-...-1d2b739 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetExecutableName

func GetExecutableName() (string, error)

GetExecutableName 返回当前执行文件的名称

func GetLocalIP

func GetLocalIP() (string, error)

GetLocalIP 返回本地机器的内网IPv4地址

func GetPublicIP

func GetPublicIP() (string, error)

func InitBase

func InitBase()

InitBase 解析参数并检测

如果在 windows 下双击打开了程序,程序将在此函数释出脚本后终止;
如果传入 -h 参数,程序将打印帮助后终止;
如果传入 -d 参数,程序将在启动 daemon 后终止。

func NoMoreDoubleClick

func NoMoreDoubleClick() error

NoMoreDoubleClick 提示用户不要双击运行,并生成安全启动脚本

func RestartApplication

func RestartApplication()

RestartApplication 封装了应用程序的重启逻辑

func RunningByDoubleClick

func RunningByDoubleClick() bool

RunningByDoubleClick 检查是否通过双击直接运行

func SetTitle

func SetTitle(title string)

SetTitle sets the window title to "Gensokyo © 2023 - [Year] Hoshinonyaruko".

Types

type Restarter

type Restarter interface {
	Restart(executableName string) error
}

Restarter is the interface that wraps the Restart method.

type UnixRestarter

type UnixRestarter struct{}

UnixRestarter implements the Restarter interface for Unix-like systems.

func NewRestarter

func NewRestarter() *UnixRestarter

NewRestarter creates a new Restarter appropriate for Unix-like systems.

func (*UnixRestarter) Restart

func (r *UnixRestarter) Restart(executableName string) error

Restart restarts the application on Unix-like systems.

Jump to

Keyboard shortcuts

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