func (res *Resource) Value() interface{} {
	if !(res.status == resourceStatusAcquired || res.status == resourceStatusHijacked) {
		panic("tried to access resource that is not acquired or hijacked")
	}
	return res.value
}
Value returns the resource value.
package puddle
import (
	"context"
	"errors"
	"sync"
	"time"
)
const (
	resourceStatusConstructing = 0
	resourceStatusIdle         = iota
	resourceStatusAcquired     = iota
	resourceStatusHijacked     = iota
)
var ErrClosedPool = errors.New("closed pool")
var ErrNotAvailable = errors.New("resource not available")
type Constructor func(ctx context.Context) (res interface{}, err error)
type Destructor func(res interface{})
type Resource struct {
	value        interface{}
	pool         *Pool
	creationTime time.Time
	lastUsedNano int64
	status       byte
}