lifecycle

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NoExtensions bool
)

Functions

func Init

func Init()

func NotifyRouterReady

func NotifyRouterReady(router *gin.Engine)

func Register

func Register(id string, secret string, h Hook) error

Register registers a lifecycle hook. Order matters: hooks are started in registration order and shutdown in reverse order.

func Shutdown

func Shutdown(ctx context.Context)

Shutdown executes all hooks in reverse order.

func Start

func Start(ctx context.Context) error

Start executes all registered hooks in order.

Types

type Hook

type Hook interface {
	OnStart(ctx context.Context) error
	OnShutdown(ctx context.Context) error
}

type RouterHook

type RouterHook interface {
	OnRouterReady(router *gin.RouterGroup)
}

Jump to

Keyboard shortcuts

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