Documentation ¶
Index ¶
- func Close(t io.Closer) error
- func Dispose(t Disposable) error
- func Release(pool ReleasePool) error
- type BaseObject
- type DefaultErrorCollector
- func (inst *DefaultErrorCollector) Append(err error)
- func (inst *DefaultErrorCollector) AppendIfFalse(value bool, msg string)
- func (inst *DefaultErrorCollector) AppendIfNil(value Object, msg string)
- func (inst *DefaultErrorCollector) LastError() error
- func (inst *DefaultErrorCollector) Result() error
- type Disposable
- type DisposableFunc
- type ErrorCollector
- type ErrorHandler
- type ErrorHandlerFunc
- type Object
- type PriorityProvider
- type ReleasePool
- type Serializable
- type SimpleReleasePool
- type Stringer
- type TryChain
- type URI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dispose ¶
func Dispose(t Disposable) error
func Release ¶
func Release(pool ReleasePool) error
Types ¶
type BaseObject ¶ added in v0.0.47
type BaseObject interface { Stringer Equals(other BaseObject) bool HashCode() int }
BaseObject 基本对象:比Object更复杂一点点
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 接口用于释放对象持有的资源
func DisposableForFunc ¶ added in v0.0.41
func DisposableForFunc(fn DisposableFunc) Disposable
DisposableForFunc 函数创建一个 DisposableFunc 的包装
type DisposableFunc ¶ added in v0.0.41
type DisposableFunc func() error
DisposableFunc Disposable 接口的函数形式
type ErrorCollector ¶
type ErrorCollector interface { Append(err error) AppendIfFalse(ok bool, msg string) AppendIfNil(target Object, msg string) LastError() error Result() error }
ErrorCollector 表示一个错误收集器
type ErrorHandler ¶
ErrorHandler 表示一个错误处理器
func NewErrorHandlerForFunc ¶ added in v0.0.48
func NewErrorHandlerForFunc(fn ErrorHandlerFunc) ErrorHandler
NewErrorHandlerForFunc 创建一个新的 ErrorHandler 作为fn的代理
type ErrorHandlerFunc ¶ added in v0.0.48
ErrorHandlerFunc 是ErrorHandler的函数形式
type PriorityProvider ¶
type PriorityProvider interface {
Priority() int
}
type ReleasePool ¶
type ReleasePool interface { Release() error Push(target Disposable) }
func CreateReleasePool ¶
func CreateReleasePool() ReleasePool
type Serializable ¶ added in v0.0.47
type Serializable interface { Stringer }
Serializable 一个标记接口:表示对象可以序列化
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 Stringer ¶ added in v0.0.33
type Stringer interface {
String() string
}
Stringer 是一个简单的接口,它把对象格式化为字符串
type URI ¶ added in v0.0.39
type URI interface { URL() *url.URL String() string Scheme() string User() string // username and password information Host() string // host or host:port Port() int Path() string // path (relative paths may omit leading slash) Query() string // encoded query values, without '?' Fragment() string // fragment for references, without '#' }
URI 提供一个只读的URI接口
Click to show internal directories.
Click to hide internal directories.