framework

package
v0.0.0-...-6d0c0f3 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Closeable

type Closeable interface {
	io.Closer
	SetOnCloseHandler(handler OnCloseHandler)
}

Closeable 可关闭对象

type CloseableObject

type CloseableObject struct {
	IsClosed bool

	Closeable
	// contains filtered or unexported fields
}

CloseableObject 实现基础流程逻辑的关闭对象

func (*CloseableObject) Close

func (c *CloseableObject) Close() error

Close 关闭流对象

func (*CloseableObject) SetOnCloseHandler

func (c *CloseableObject) SetOnCloseHandler(handler OnCloseHandler)

SetOnCloseHandler 设置关闭时需要执行的句柄

type OnCloseHandler

type OnCloseHandler interface {
	// OnClosing 关闭前需要处理的事务,如果要拒绝继续关闭,返回false
	OnClosing() bool
	// OnClosed 关闭后的事务,仅当完毕完成才会执行此业务
	OnClosed() error
}

OnCloseHandler 关闭的api接口

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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