mirror of
https://github.com/containers/podman.git
synced 2025-10-29 17:06:22 +08:00
Add API for communicating with Docker volume plugins
Docker provides extensibility through a plugin system, of which several types are available. This provides an initial library API for communicating with one type of plugins, volume plugins. Volume plugins allow for an external service to create and manage a volume on Podman's behalf. This does not integrate the plugin system into Libpod or Podman yet; that will come in subsequent pull requests. Signed-off-by: Matthew Heon <mheon@redhat.com>
This commit is contained in:
18
vendor/github.com/docker/go-plugins-helpers/sdk/pool.go
generated
vendored
Normal file
18
vendor/github.com/docker/go-plugins-helpers/sdk/pool.go
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
package sdk
|
||||
|
||||
import (
|
||||
"io"
|
||||
"sync"
|
||||
)
|
||||
|
||||
const buffer32K = 32 * 1024
|
||||
|
||||
var buffer32KPool = &sync.Pool{New: func() interface{} { return make([]byte, buffer32K) }}
|
||||
|
||||
// copyBuf uses a shared buffer pool with io.CopyBuffer
|
||||
func copyBuf(w io.Writer, r io.Reader) (int64, error) {
|
||||
buf := buffer32KPool.Get().([]byte)
|
||||
written, err := io.CopyBuffer(w, r, buf)
|
||||
buffer32KPool.Put(buf)
|
||||
return written, err
|
||||
}
|
||||
Reference in New Issue
Block a user