core

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecPathDir

func ExecPathDir() string

func Unmarshal

func Unmarshal(src, dst interface{}) error

Types

type App

type App struct {
	EventRegList []chan ghook.Event
	// contains filtered or unexported fields
}

func NewApp

func NewApp(index func(r *ghttp.Request), configPath, name, version string, ioc []byte) (*App, error)

func (*App) RegisterModule

func (a *App) RegisterModule(module ...*Module)

func (*App) Run

func (a *App) Run() error

type Hook added in v0.0.6

type Hook interface {
	// WithSignals add more signals into hook
	WithSignals(signals ...syscall.Signal) Hook

	// Close register shutdown handles
	Close(funcs ...func())
}

Hook a graceful shutdown hook, default with signals of SIGINT and SIGTERM

func NewHook added in v0.0.6

func NewHook() Hook

NewHook create a Hook instance

type Module

type Module struct {
	Config interface{}

	Port uint16
	// contains filtered or unexported fields
}

func NewModule

func NewModule(name, itemName, tooltip string, onReady func(item *systray.MenuItem), exit func(), route func(*ghttp.RouterGroup)) *Module

NewModule name是该模块的名字 itemName是显示在任务栏的名字 tooltip是鼠标移动到该模块子项时提示的文字 onReady是初始化完成后执行的函数 exit是退出时执行的函数 route是http录音函数

func (*Module) GetAPPName added in v0.0.8

func (m *Module) GetAPPName() string

func (*Module) GetAPPVersion added in v0.0.8

func (m *Module) GetAPPVersion() string

func (*Module) GetRootUrl

func (m *Module) GetRootUrl() string

func (*Module) Notify

func (m *Module) Notify(str string)

func (*Module) RegEvent added in v0.1.1

func (m *Module) RegEvent() chan ghook.Event

func (*Module) RemoveTitle

func (m *Module) RemoveTitle()

func (*Module) SaveConfig

func (m *Module) SaveConfig(c interface{})

func (*Module) SetTitle

func (m *Module) SetTitle(title string)

func (*Module) Tip

func (m *Module) Tip(str string, time time.Duration)

func (*Module) UnmarshalConfig

func (m *Module) UnmarshalConfig(dst interface{}) error

type ModuleConfig

type ModuleConfig struct {
	Enable bool        `json:"enable"`
	Config interface{} `json:"config"`
}

Jump to

Keyboard shortcuts

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