Documentation
¶
Overview ¶
* Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. * PilotGo-plugin-topology licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: Wangjunqi123 <wangjunqi@kylinos.cn> * Date: Fri Nov 8 09:13:05 2024 +0800
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorReleaseManagement ¶
type ErrorReleaseManagement struct {
ErrChan chan error
// GoCancelCtx: ERManager 用于控制项目指定goroutine优雅退出的上下文
GoCancelCtx context.Context
GoCancelFunc context.CancelFunc
Wg sync.WaitGroup
// contains filtered or unexported fields
}
func CreateErrorReleaseManager ¶
func CreateErrorReleaseManager(_ctx context.Context, _releaseFunc ResourceReleaseFunction) (*ErrorReleaseManagement, error)
func (*ErrorReleaseManagement) ErrorTransmit ¶
func (erm *ErrorReleaseManagement) ErrorTransmit(_module, _severity string, _err error, _exit_after_print, _print_stack bool)
@severity: debug info warn error
@err: 最终生成的error
@exit_after_print: 打印完异常日志后是否结束主程序
@print_stack: 是否打印异常日志错误链,打印错误链时默认severity为error
func (*ErrorReleaseManagement) ResourceRelease ¶
func (erm *ErrorReleaseManagement) ResourceRelease()
type FinalError ¶
type FinalError struct {
Err error
Module string
Severity string
Cancel context.CancelFunc
PrintStack bool
ExitAfterPrint bool
}
func (*FinalError) Error ¶
func (e *FinalError) Error() string
type ResourceReleaseFunction ¶
type ResourceReleaseFunction func()
Click to show internal directories.
Click to hide internal directories.