core

package
v1.5.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 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/kumahq/kuma/issues/2798
	Log                   = kube_log.Log
	NewLogger             = kuma_log.NewLogger
	NewLoggerWithRotation = kuma_log.NewLoggerWithRotation
	SetLogger             = kube_log.SetLogger
	Now                   = time.Now
	TempDir               = os.TempDir

	SetupSignalHandler = func() context.Context {
		ctx, cancel := context.WithCancel(context.Background())
		c := make(chan os.Signal, 2)
		signal.Notify(c, syscall.SIGINT, syscall.SIGTERM)
		go func() {
			s := <-c
			Log.Info("Received signal, stopping instance", "signal", s.String())
			cancel()
			s = <-c
			Log.Info("Received second signal, force exit", "signal", s.String())
			os.Exit(1)
		}()
		return ctx
	}
)

Functions

func NewUUID

func NewUUID() string

Types

This section is empty.

Jump to

Keyboard shortcuts

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