core

package
v0.0.0-...-2c3524d Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TODO remove dependency on kubernetes see: https://github.com/apache/dubbo-kubernetes/issues/2798
	Log                   = kube_log.Log
	NewLogger             = dubbo_log.NewLogger
	NewLoggerTo           = dubbo_log.NewLoggerTo
	NewLoggerWithRotation = dubbo_log.NewLoggerWithRotation
	SetLogger             = kube_log.SetLogger
	Now                   = time.Now

	SetupSignalHandler = func() (context.Context, context.Context) {
		gracefulCtx, gracefulCancel := context.WithCancel(context.Background())
		ctx, cancel := context.WithCancel(context.Background())
		c := make(chan os.Signal, 3)
		signal.Notify(c, syscall.SIGINT, syscall.SIGTERM)
		go func() {
			logger := Log.WithName("runtime")
			s := <-c
			logger.Info("received signal, stopping instance gracefully", "signal", s.String())
			gracefulCancel()
			s = <-c
			logger.Info("received second signal, stopping instance", "signal", s.String())
			cancel()
			s = <-c
			logger.Info("received third signal, force exit", "signal", s.String())
			os.Exit(1)
		}()
		return gracefulCtx, ctx
	}
)

Functions

func NewUUID

func NewUUID() string

Types

This section is empty.

Directories

Path Synopsis
ca
cmd
config
dns
Package config is a generated GoMock package.
Package config is a generated GoMock package.
managers
resources

Jump to

Keyboard shortcuts

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