lang

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: MIT Imports: 3 Imported by: 49

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(t io.Closer) error

func Dispose

func Dispose(t Disposable) error

func Release

func Release(pool ReleasePool) error

Types

type DefaultErrorCollector

type DefaultErrorCollector struct {
	// contains filtered or unexported fields
}

func (*DefaultErrorCollector) Append

func (inst *DefaultErrorCollector) Append(err error)

func (*DefaultErrorCollector) AppendIfFalse

func (inst *DefaultErrorCollector) AppendIfFalse(value bool, msg string)

func (*DefaultErrorCollector) AppendIfNil

func (inst *DefaultErrorCollector) AppendIfNil(value Object, msg string)

func (*DefaultErrorCollector) LastError

func (inst *DefaultErrorCollector) LastError() error

func (*DefaultErrorCollector) Result

func (inst *DefaultErrorCollector) Result() error

type Disposable

type Disposable interface {
	Dispose() error
}

Disposable 接口用于释放对象持有的资源

type ErrorCollector

type ErrorCollector interface {
	Append(err error)
	AppendIfFalse(ok bool, msg string)
	AppendIfNil(target Object, msg string)

	LastError() error
	Result() error
}

ErrorCollector 表示一个错误收集器

func NewErrorCollector

func NewErrorCollector() ErrorCollector

NewErrorCollector 创建一个错误收集器

type ErrorHandler

type ErrorHandler interface {
	OnError(err error)
}

func DefaultErrorHandler

func DefaultErrorHandler() ErrorHandler

type Object

type Object interface {
}

type PriorityProvider

type PriorityProvider interface {
	Priority() int
}

type ReleasePool

type ReleasePool interface {
	Release() error
	Push(target Disposable)
}

func CreateReleasePool

func CreateReleasePool() ReleasePool

type SimpleReleasePool

type SimpleReleasePool struct {
	// contains filtered or unexported fields
}

func (*SimpleReleasePool) Push

func (inst *SimpleReleasePool) Push(target Disposable)

func (*SimpleReleasePool) Release

func (inst *SimpleReleasePool) Release() error

type TryChain

type TryChain struct {
	// contains filtered or unexported fields
}

func (*TryChain) Result

func (inst *TryChain) Result() error

func (*TryChain) Try

func (inst *TryChain) Try(task func() error) *TryChain

Jump to

Keyboard shortcuts

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