vendor: github.com/docker/docker 69687190936d (master, v28.0-dev)
full diff: 50212d215b...6968719093
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
4e217ae9c1
commit
0df55307c8
@ -13,7 +13,7 @@ require (
|
|||||||
github.com/distribution/reference v0.6.0
|
github.com/distribution/reference v0.6.0
|
||||||
github.com/docker/cli-docs-tool v0.8.0
|
github.com/docker/cli-docs-tool v0.8.0
|
||||||
github.com/docker/distribution v2.8.3+incompatible
|
github.com/docker/distribution v2.8.3+incompatible
|
||||||
github.com/docker/docker v27.0.2-0.20250108165300-50212d215ba7+incompatible // master (v-next)
|
github.com/docker/docker v27.0.2-0.20250110234321-69687190936d+incompatible // master (v-next)
|
||||||
github.com/docker/docker-credential-helpers v0.8.2
|
github.com/docker/docker-credential-helpers v0.8.2
|
||||||
github.com/docker/go-connections v0.5.0
|
github.com/docker/go-connections v0.5.0
|
||||||
github.com/docker/go-units v0.5.0
|
github.com/docker/go-units v0.5.0
|
||||||
|
@ -51,8 +51,8 @@ github.com/docker/cli-docs-tool v0.8.0/go.mod h1:8TQQ3E7mOXoYUs811LiPdUnAhXrcVsB
|
|||||||
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
||||||
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
|
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
|
||||||
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
||||||
github.com/docker/docker v27.0.2-0.20250108165300-50212d215ba7+incompatible h1:d2wmwnGBWKKlr7JBS6SD/1O3DRvZATLQg4tbgk0rzvo=
|
github.com/docker/docker v27.0.2-0.20250110234321-69687190936d+incompatible h1:JqToo31hcYA8YAJwnaF1aq7WUhFRcMNPnkKCUzGFGJM=
|
||||||
github.com/docker/docker v27.0.2-0.20250108165300-50212d215ba7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
github.com/docker/docker v27.0.2-0.20250110234321-69687190936d+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
||||||
github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo=
|
github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo=
|
||||||
github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M=
|
github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M=
|
||||||
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=
|
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=
|
||||||
|
22
vendor/github.com/docker/docker/pkg/archive/archive.go
generated
vendored
22
vendor/github.com/docker/docker/pkg/archive/archive.go
generated
vendored
@ -472,13 +472,35 @@ func (compression *Compression) Extension() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// assert that we implement [tar.FileInfoNames].
|
||||||
|
//
|
||||||
|
// TODO(thaJeztah): disabled to allow compiling on < go1.23. un-comment once we drop support for older versions of go.
|
||||||
|
// var _ tar.FileInfoNames = (*nosysFileInfo)(nil)
|
||||||
|
|
||||||
// nosysFileInfo hides the system-dependent info of the wrapped FileInfo to
|
// nosysFileInfo hides the system-dependent info of the wrapped FileInfo to
|
||||||
// prevent tar.FileInfoHeader from introspecting it and potentially calling into
|
// prevent tar.FileInfoHeader from introspecting it and potentially calling into
|
||||||
// glibc.
|
// glibc.
|
||||||
|
//
|
||||||
|
// It implements [tar.FileInfoNames] to further prevent [tar.FileInfoHeader]
|
||||||
|
// from performing any lookups on go1.23 and up. see https://go.dev/issue/50102
|
||||||
type nosysFileInfo struct {
|
type nosysFileInfo struct {
|
||||||
os.FileInfo
|
os.FileInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Uname stubs out looking up username. It implements [tar.FileInfoNames]
|
||||||
|
// to prevent [tar.FileInfoHeader] from loading libraries to perform
|
||||||
|
// username lookups.
|
||||||
|
func (fi nosysFileInfo) Uname() (string, error) {
|
||||||
|
return "", nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Gname stubs out looking up group-name. It implements [tar.FileInfoNames]
|
||||||
|
// to prevent [tar.FileInfoHeader] from loading libraries to perform
|
||||||
|
// username lookups.
|
||||||
|
func (fi nosysFileInfo) Gname() (string, error) {
|
||||||
|
return "", nil
|
||||||
|
}
|
||||||
|
|
||||||
func (fi nosysFileInfo) Sys() interface{} {
|
func (fi nosysFileInfo) Sys() interface{} {
|
||||||
// A Sys value of type *tar.Header is safe as it is system-independent.
|
// A Sys value of type *tar.Header is safe as it is system-independent.
|
||||||
// The tar.FileInfoHeader function copies the fields into the returned
|
// The tar.FileInfoHeader function copies the fields into the returned
|
||||||
|
51
vendor/github.com/docker/docker/pkg/ioutils/buffer.go
generated
vendored
51
vendor/github.com/docker/docker/pkg/ioutils/buffer.go
generated
vendored
@ -1,51 +0,0 @@
|
|||||||
package ioutils // import "github.com/docker/docker/pkg/ioutils"
|
|
||||||
|
|
||||||
import (
|
|
||||||
"errors"
|
|
||||||
"io"
|
|
||||||
)
|
|
||||||
|
|
||||||
var errBufferFull = errors.New("buffer is full")
|
|
||||||
|
|
||||||
type fixedBuffer struct {
|
|
||||||
buf []byte
|
|
||||||
pos int
|
|
||||||
lastRead int
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *fixedBuffer) Write(p []byte) (int, error) {
|
|
||||||
n := copy(b.buf[b.pos:cap(b.buf)], p)
|
|
||||||
b.pos += n
|
|
||||||
|
|
||||||
if n < len(p) {
|
|
||||||
if b.pos == cap(b.buf) {
|
|
||||||
return n, errBufferFull
|
|
||||||
}
|
|
||||||
return n, io.ErrShortWrite
|
|
||||||
}
|
|
||||||
return n, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *fixedBuffer) Read(p []byte) (int, error) {
|
|
||||||
n := copy(p, b.buf[b.lastRead:b.pos])
|
|
||||||
b.lastRead += n
|
|
||||||
return n, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *fixedBuffer) Len() int {
|
|
||||||
return b.pos - b.lastRead
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *fixedBuffer) Cap() int {
|
|
||||||
return cap(b.buf)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *fixedBuffer) Reset() {
|
|
||||||
b.pos = 0
|
|
||||||
b.lastRead = 0
|
|
||||||
b.buf = b.buf[:0]
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *fixedBuffer) String() string {
|
|
||||||
return string(b.buf[b.lastRead:b.pos])
|
|
||||||
}
|
|
187
vendor/github.com/docker/docker/pkg/ioutils/bytespipe.go
generated
vendored
187
vendor/github.com/docker/docker/pkg/ioutils/bytespipe.go
generated
vendored
@ -1,187 +0,0 @@
|
|||||||
package ioutils // import "github.com/docker/docker/pkg/ioutils"
|
|
||||||
|
|
||||||
import (
|
|
||||||
"errors"
|
|
||||||
"io"
|
|
||||||
"sync"
|
|
||||||
)
|
|
||||||
|
|
||||||
// maxCap is the highest capacity to use in byte slices that buffer data.
|
|
||||||
const maxCap = 1e6
|
|
||||||
|
|
||||||
// minCap is the lowest capacity to use in byte slices that buffer data
|
|
||||||
const minCap = 64
|
|
||||||
|
|
||||||
// blockThreshold is the minimum number of bytes in the buffer which will cause
|
|
||||||
// a write to BytesPipe to block when allocating a new slice.
|
|
||||||
const blockThreshold = 1e6
|
|
||||||
|
|
||||||
var (
|
|
||||||
// ErrClosed is returned when Write is called on a closed BytesPipe.
|
|
||||||
ErrClosed = errors.New("write to closed BytesPipe")
|
|
||||||
|
|
||||||
bufPools = make(map[int]*sync.Pool)
|
|
||||||
bufPoolsLock sync.Mutex
|
|
||||||
)
|
|
||||||
|
|
||||||
// BytesPipe is io.ReadWriteCloser which works similarly to pipe(queue).
|
|
||||||
// All written data may be read at most once. Also, BytesPipe allocates
|
|
||||||
// and releases new byte slices to adjust to current needs, so the buffer
|
|
||||||
// won't be overgrown after peak loads.
|
|
||||||
type BytesPipe struct {
|
|
||||||
mu sync.Mutex
|
|
||||||
wait *sync.Cond
|
|
||||||
buf []*fixedBuffer
|
|
||||||
bufLen int
|
|
||||||
closeErr error // error to return from next Read. set to nil if not closed.
|
|
||||||
readBlock bool // check read BytesPipe is Wait() or not
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewBytesPipe creates new BytesPipe, initialized by specified slice.
|
|
||||||
// If buf is nil, then it will be initialized with slice which cap is 64.
|
|
||||||
// buf will be adjusted in a way that len(buf) == 0, cap(buf) == cap(buf).
|
|
||||||
func NewBytesPipe() *BytesPipe {
|
|
||||||
bp := &BytesPipe{}
|
|
||||||
bp.buf = append(bp.buf, getBuffer(minCap))
|
|
||||||
bp.wait = sync.NewCond(&bp.mu)
|
|
||||||
return bp
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write writes p to BytesPipe.
|
|
||||||
// It can allocate new []byte slices in a process of writing.
|
|
||||||
func (bp *BytesPipe) Write(p []byte) (int, error) {
|
|
||||||
bp.mu.Lock()
|
|
||||||
defer bp.mu.Unlock()
|
|
||||||
|
|
||||||
written := 0
|
|
||||||
loop0:
|
|
||||||
for {
|
|
||||||
if bp.closeErr != nil {
|
|
||||||
return written, ErrClosed
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(bp.buf) == 0 {
|
|
||||||
bp.buf = append(bp.buf, getBuffer(64))
|
|
||||||
}
|
|
||||||
// get the last buffer
|
|
||||||
b := bp.buf[len(bp.buf)-1]
|
|
||||||
|
|
||||||
n, err := b.Write(p)
|
|
||||||
written += n
|
|
||||||
bp.bufLen += n
|
|
||||||
|
|
||||||
// errBufferFull is an error we expect to get if the buffer is full
|
|
||||||
if err != nil && err != errBufferFull {
|
|
||||||
bp.wait.Broadcast()
|
|
||||||
return written, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// if there was enough room to write all then break
|
|
||||||
if len(p) == n {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
// more data: write to the next slice
|
|
||||||
p = p[n:]
|
|
||||||
|
|
||||||
// make sure the buffer doesn't grow too big from this write
|
|
||||||
for bp.bufLen >= blockThreshold {
|
|
||||||
if bp.readBlock {
|
|
||||||
bp.wait.Broadcast()
|
|
||||||
}
|
|
||||||
bp.wait.Wait()
|
|
||||||
if bp.closeErr != nil {
|
|
||||||
continue loop0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// add new byte slice to the buffers slice and continue writing
|
|
||||||
nextCap := b.Cap() * 2
|
|
||||||
if nextCap > maxCap {
|
|
||||||
nextCap = maxCap
|
|
||||||
}
|
|
||||||
bp.buf = append(bp.buf, getBuffer(nextCap))
|
|
||||||
}
|
|
||||||
bp.wait.Broadcast()
|
|
||||||
return written, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// CloseWithError causes further reads from a BytesPipe to return immediately.
|
|
||||||
func (bp *BytesPipe) CloseWithError(err error) error {
|
|
||||||
bp.mu.Lock()
|
|
||||||
if err != nil {
|
|
||||||
bp.closeErr = err
|
|
||||||
} else {
|
|
||||||
bp.closeErr = io.EOF
|
|
||||||
}
|
|
||||||
bp.wait.Broadcast()
|
|
||||||
bp.mu.Unlock()
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Close causes further reads from a BytesPipe to return immediately.
|
|
||||||
func (bp *BytesPipe) Close() error {
|
|
||||||
return bp.CloseWithError(nil)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Read reads bytes from BytesPipe.
|
|
||||||
// Data could be read only once.
|
|
||||||
func (bp *BytesPipe) Read(p []byte) (n int, err error) {
|
|
||||||
bp.mu.Lock()
|
|
||||||
defer bp.mu.Unlock()
|
|
||||||
if bp.bufLen == 0 {
|
|
||||||
if bp.closeErr != nil {
|
|
||||||
return 0, bp.closeErr
|
|
||||||
}
|
|
||||||
bp.readBlock = true
|
|
||||||
bp.wait.Wait()
|
|
||||||
bp.readBlock = false
|
|
||||||
if bp.bufLen == 0 && bp.closeErr != nil {
|
|
||||||
return 0, bp.closeErr
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for bp.bufLen > 0 {
|
|
||||||
b := bp.buf[0]
|
|
||||||
read, _ := b.Read(p) // ignore error since fixedBuffer doesn't really return an error
|
|
||||||
n += read
|
|
||||||
bp.bufLen -= read
|
|
||||||
|
|
||||||
if b.Len() == 0 {
|
|
||||||
// it's empty so return it to the pool and move to the next one
|
|
||||||
returnBuffer(b)
|
|
||||||
bp.buf[0] = nil
|
|
||||||
bp.buf = bp.buf[1:]
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(p) == read {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
p = p[read:]
|
|
||||||
}
|
|
||||||
|
|
||||||
bp.wait.Broadcast()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func returnBuffer(b *fixedBuffer) {
|
|
||||||
b.Reset()
|
|
||||||
bufPoolsLock.Lock()
|
|
||||||
pool := bufPools[b.Cap()]
|
|
||||||
bufPoolsLock.Unlock()
|
|
||||||
if pool != nil {
|
|
||||||
pool.Put(b)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func getBuffer(size int) *fixedBuffer {
|
|
||||||
bufPoolsLock.Lock()
|
|
||||||
pool, ok := bufPools[size]
|
|
||||||
if !ok {
|
|
||||||
pool = &sync.Pool{New: func() interface{} { return &fixedBuffer{buf: make([]byte, 0, size)} }}
|
|
||||||
bufPools[size] = pool
|
|
||||||
}
|
|
||||||
bufPoolsLock.Unlock()
|
|
||||||
return pool.Get().(*fixedBuffer)
|
|
||||||
}
|
|
39
vendor/github.com/docker/docker/pkg/ioutils/readers.go
generated
vendored
39
vendor/github.com/docker/docker/pkg/ioutils/readers.go
generated
vendored
@ -2,29 +2,28 @@ package ioutils // import "github.com/docker/docker/pkg/ioutils"
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"io"
|
|
||||||
"runtime/debug"
|
|
||||||
"sync/atomic"
|
|
||||||
|
|
||||||
// make sure crypto.SHA256, crypto.sha512 and crypto.SHA384 are registered
|
// make sure crypto.SHA256, crypto.sha512 and crypto.SHA384 are registered
|
||||||
// TODO remove once https://github.com/opencontainers/go-digest/pull/64 is merged.
|
// TODO remove once https://github.com/opencontainers/go-digest/pull/64 is merged.
|
||||||
_ "crypto/sha256"
|
_ "crypto/sha256"
|
||||||
_ "crypto/sha512"
|
_ "crypto/sha512"
|
||||||
|
"io"
|
||||||
|
"runtime/debug"
|
||||||
|
"sync/atomic"
|
||||||
|
|
||||||
"github.com/containerd/log"
|
"github.com/containerd/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ReadCloserWrapper wraps an io.Reader, and implements an io.ReadCloser
|
// readCloserWrapper wraps an io.Reader, and implements an io.ReadCloser
|
||||||
// It calls the given callback function when closed. It should be constructed
|
// It calls the given callback function when closed. It should be constructed
|
||||||
// with NewReadCloserWrapper
|
// with NewReadCloserWrapper
|
||||||
type ReadCloserWrapper struct {
|
type readCloserWrapper struct {
|
||||||
io.Reader
|
io.Reader
|
||||||
closer func() error
|
closer func() error
|
||||||
closed atomic.Bool
|
closed atomic.Bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close calls back the passed closer function
|
// Close calls back the passed closer function
|
||||||
func (r *ReadCloserWrapper) Close() error {
|
func (r *readCloserWrapper) Close() error {
|
||||||
if !r.closed.CompareAndSwap(false, true) {
|
if !r.closed.CompareAndSwap(false, true) {
|
||||||
subsequentCloseWarn("ReadCloserWrapper")
|
subsequentCloseWarn("ReadCloserWrapper")
|
||||||
return nil
|
return nil
|
||||||
@ -32,35 +31,15 @@ func (r *ReadCloserWrapper) Close() error {
|
|||||||
return r.closer()
|
return r.closer()
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewReadCloserWrapper returns a new io.ReadCloser.
|
// NewReadCloserWrapper wraps an io.Reader, and implements an io.ReadCloser.
|
||||||
|
// It calls the given callback function when closed.
|
||||||
func NewReadCloserWrapper(r io.Reader, closer func() error) io.ReadCloser {
|
func NewReadCloserWrapper(r io.Reader, closer func() error) io.ReadCloser {
|
||||||
return &ReadCloserWrapper{
|
return &readCloserWrapper{
|
||||||
Reader: r,
|
Reader: r,
|
||||||
closer: closer,
|
closer: closer,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type readerErrWrapper struct {
|
|
||||||
reader io.Reader
|
|
||||||
closer func()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *readerErrWrapper) Read(p []byte) (int, error) {
|
|
||||||
n, err := r.reader.Read(p)
|
|
||||||
if err != nil {
|
|
||||||
r.closer()
|
|
||||||
}
|
|
||||||
return n, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewReaderErrWrapper returns a new io.Reader.
|
|
||||||
func NewReaderErrWrapper(r io.Reader, closer func()) io.Reader {
|
|
||||||
return &readerErrWrapper{
|
|
||||||
reader: r,
|
|
||||||
closer: closer,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// cancelReadCloser wraps an io.ReadCloser with a context for cancelling read
|
// cancelReadCloser wraps an io.ReadCloser with a context for cancelling read
|
||||||
// operations.
|
// operations.
|
||||||
type cancelReadCloser struct {
|
type cancelReadCloser struct {
|
||||||
|
14
vendor/github.com/docker/docker/pkg/ioutils/writeflusher.go
generated
vendored
14
vendor/github.com/docker/docker/pkg/ioutils/writeflusher.go
generated
vendored
@ -21,12 +21,10 @@ type flusher interface {
|
|||||||
Flush()
|
Flush()
|
||||||
}
|
}
|
||||||
|
|
||||||
var errWriteFlusherClosed = io.EOF
|
|
||||||
|
|
||||||
func (wf *WriteFlusher) Write(b []byte) (n int, err error) {
|
func (wf *WriteFlusher) Write(b []byte) (n int, err error) {
|
||||||
select {
|
select {
|
||||||
case <-wf.closed:
|
case <-wf.closed:
|
||||||
return 0, errWriteFlusherClosed
|
return 0, io.EOF
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,20 +71,26 @@ func (wf *WriteFlusher) Close() error {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-wf.closed:
|
case <-wf.closed:
|
||||||
return errWriteFlusherClosed
|
return io.EOF
|
||||||
default:
|
default:
|
||||||
close(wf.closed)
|
close(wf.closed)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nopFlusher represents a type which flush operation is nop.
|
||||||
|
type nopFlusher struct{}
|
||||||
|
|
||||||
|
// Flush is a nop operation.
|
||||||
|
func (f *nopFlusher) Flush() {}
|
||||||
|
|
||||||
// NewWriteFlusher returns a new WriteFlusher.
|
// NewWriteFlusher returns a new WriteFlusher.
|
||||||
func NewWriteFlusher(w io.Writer) *WriteFlusher {
|
func NewWriteFlusher(w io.Writer) *WriteFlusher {
|
||||||
var fl flusher
|
var fl flusher
|
||||||
if f, ok := w.(flusher); ok {
|
if f, ok := w.(flusher); ok {
|
||||||
fl = f
|
fl = f
|
||||||
} else {
|
} else {
|
||||||
fl = &NopFlusher{}
|
fl = &nopFlusher{}
|
||||||
}
|
}
|
||||||
return &WriteFlusher{w: w, flusher: fl, closed: make(chan struct{}), flushed: make(chan struct{})}
|
return &WriteFlusher{w: w, flusher: fl, closed: make(chan struct{}), flushed: make(chan struct{})}
|
||||||
}
|
}
|
||||||
|
46
vendor/github.com/docker/docker/pkg/ioutils/writers.go
generated
vendored
46
vendor/github.com/docker/docker/pkg/ioutils/writers.go
generated
vendored
@ -5,30 +5,6 @@ import (
|
|||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NopWriter represents a type which write operation is nop.
|
|
||||||
type NopWriter struct{}
|
|
||||||
|
|
||||||
func (*NopWriter) Write(buf []byte) (int, error) {
|
|
||||||
return len(buf), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type nopWriteCloser struct {
|
|
||||||
io.Writer
|
|
||||||
}
|
|
||||||
|
|
||||||
func (w *nopWriteCloser) Close() error { return nil }
|
|
||||||
|
|
||||||
// NopWriteCloser returns a nopWriteCloser.
|
|
||||||
func NopWriteCloser(w io.Writer) io.WriteCloser {
|
|
||||||
return &nopWriteCloser{w}
|
|
||||||
}
|
|
||||||
|
|
||||||
// NopFlusher represents a type which flush operation is nop.
|
|
||||||
type NopFlusher struct{}
|
|
||||||
|
|
||||||
// Flush is a nop operation.
|
|
||||||
func (f *NopFlusher) Flush() {}
|
|
||||||
|
|
||||||
type writeCloserWrapper struct {
|
type writeCloserWrapper struct {
|
||||||
io.Writer
|
io.Writer
|
||||||
closer func() error
|
closer func() error
|
||||||
@ -50,25 +26,3 @@ func NewWriteCloserWrapper(r io.Writer, closer func() error) io.WriteCloser {
|
|||||||
closer: closer,
|
closer: closer,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WriteCounter wraps a concrete io.Writer and hold a count of the number
|
|
||||||
// of bytes written to the writer during a "session".
|
|
||||||
// This can be convenient when write return is masked
|
|
||||||
// (e.g., json.Encoder.Encode())
|
|
||||||
type WriteCounter struct {
|
|
||||||
Count int64
|
|
||||||
Writer io.Writer
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewWriteCounter returns a new WriteCounter.
|
|
||||||
func NewWriteCounter(w io.Writer) *WriteCounter {
|
|
||||||
return &WriteCounter{
|
|
||||||
Writer: w,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (wc *WriteCounter) Write(p []byte) (count int, err error) {
|
|
||||||
count, err = wc.Writer.Write(p)
|
|
||||||
wc.Count += int64(count)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@ -55,7 +55,7 @@ github.com/docker/distribution/registry/client/transport
|
|||||||
github.com/docker/distribution/registry/storage/cache
|
github.com/docker/distribution/registry/storage/cache
|
||||||
github.com/docker/distribution/registry/storage/cache/memory
|
github.com/docker/distribution/registry/storage/cache/memory
|
||||||
github.com/docker/distribution/uuid
|
github.com/docker/distribution/uuid
|
||||||
# github.com/docker/docker v27.0.2-0.20250108165300-50212d215ba7+incompatible
|
# github.com/docker/docker v27.0.2-0.20250110234321-69687190936d+incompatible
|
||||||
## explicit
|
## explicit
|
||||||
github.com/docker/docker/api
|
github.com/docker/docker/api
|
||||||
github.com/docker/docker/api/types
|
github.com/docker/docker/api/types
|
||||||
|
Loading…
x
Reference in New Issue
Block a user