mirror of
https://github.com/foxcpp/maddy.git
synced 2026-02-14 19:49:03 +02:00
19 lines
285 B
Go
19 lines
285 B
Go
package resource
|
|
|
|
import (
|
|
"io"
|
|
)
|
|
|
|
type Resource = io.Closer
|
|
|
|
type CheckableResource interface {
|
|
Resource
|
|
IsUsable() bool
|
|
}
|
|
|
|
type Container[T Resource] interface {
|
|
io.Closer
|
|
GetOpen(key string, open func() (T, error)) (T, error)
|
|
CloseUnused(isUsed func(key string) bool) error
|
|
}
|