core

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Development = "development"
	Production  = "production"
)

Variables

View Source
var EnvName string
View Source
var WorkDir string

Functions

func AddComponents

func AddComponents(instances ...Component)

AddComponents 添加组件

func DeferAdd

func DeferAdd(handle DeferHandler)

DeferAdd 添加任务

func DeferRun

func DeferRun()

DeferRun 运行任务

func GetComponentConfiguration

func GetComponentConfiguration(name string, conf interface{}) error

GetComponentConfiguration 获取组件配置

func LoadComponents

func LoadComponents()

LoadComponents 加载组件

func LoadConfigurationFile

func LoadConfigurationFile(path string) error

LoadConfigurationFile 加载配置

func SignalHandle

func SignalHandle(handler *SignalHandler)

func SignalNotify

func SignalNotify()

SignalNotify 监听所有信号

Types

type Component

type Component interface {
	Load() error
	GetName() string
}

type DeferHandler

type DeferHandler func()

type SignalHandler

type SignalHandler struct {
	Sig syscall.Signal
	F   func()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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