reload

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*options)

Option 是热重载器选项函数

func WithCallback

func WithCallback(callback func(config.Config) error) Option

WithCallback 添加重载回调

func WithInterval

func WithInterval(interval time.Duration) Option

WithInterval 设置重载间隔

type Reloader

type Reloader interface {
	// Start 启动热重载
	Start() error
	// Stop 停止热重载
	Stop() error
	// SetInterval 设置重载间隔
	SetInterval(interval time.Duration)
	// AddCallback 添加重载回调
	AddCallback(callback func(config.Config) error) error
}

Reloader 是配置热重载器接口

func New

func New(cfg config.Config, opts ...Option) Reloader

New 创建一个热重载器

Jump to

Keyboard shortcuts

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