listener

package
v3.3.9 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoPostStop

func DoPostStop(listeners []ApplicationListener)

DoPostStop triggers the PostStop event.

func DoPreApply

func DoPreApply(listeners []ApplicationListener)

DoPreApply triggers the PreApply event.

func DoPreStart

func DoPreStart(listeners []ApplicationListener)

DoPreStart triggers the PreStart event.

func DoPreStop

func DoPreStop(listeners []ApplicationListener)

DoPreStop triggers the PreStop event.

Types

type ApplicationEventListener

type ApplicationEventListener interface {
	ApplicationListener

	// PreApply is triggered before the MVC framework starts, and before the application fully initiates.
	// This is the stage where you can set up basic services, such as registering beans.
	// Additionally, any logic that doesn't require access to beans can be executed here.
	PreApply()

	// PreStart is the final event before the application starts running, after all dependency injections have been completed.
	// At this point, you can execute any necessary logic to prepare for the application's startup.
	PreStart()

	// PreStop is triggered before the application stops, providing an opportunity to close resources
	// or perform other pre-shutdown tasks.
	PreStop()

	// PostStop is triggered after the application has stopped, allowing for final cleanup operations
	// or any other shutdown-related activities.
	PostStop()
}

ApplicationEventListener defines an interface for listening to application lifecycle events.

type ApplicationListener

type ApplicationListener interface{}

ApplicationListener Application listener

type ConfigListener

type ConfigListener interface {
	ApplicationListener

	// Read loads the configuration settings from the provided Viper instance.
	// This method is intended to be implemented by users to define custom
	// configuration loading logic.
	Read(v *viper.Viper) error

	// After is called after the configuration has been successfully read.
	// This method allows for any additional processing or setup that may
	// be required after the initial configuration load.
	After(v *viper.Viper)
}

ConfigListener defines an interface for configuration listeners that are used to load and process configuration settings.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳