runtimekit

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package runtimekit provides runtime helpers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallerLineInfo

func CallerLineInfo(skip int) string

CallerLineInfo returns caller file:line-package.function e.g. service.go:38-service.CallAPI.

func ExecuteBackground

func ExecuteBackground(fn func())

ExecuteBackground a function, and log the error when panic found. executing a background functions may cause unhandled panic by middlewares.

func FunctionName

func FunctionName() string

FunctionName returns this function caller's name useful to wrap span, trace, context info e.g. trace.Start(ctx, runtimekit.FunctionName()).

func NewRuntimeContext

func NewRuntimeContext() (context.Context, context.CancelFunc)

NewRuntimeContext returns context & cancel func listening to : - os.Interrupt - syscall.SIGTERM - syscall.SIGINT.

func SkippedFunctionName

func SkippedFunctionName(skip int) string

SkippedFunctionName returns function caller's name with skipped count.

Types

This section is empty.

Jump to

Keyboard shortcuts

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