Documentation
¶
Overview ¶
Contains code adapted from:
https://github.com/moby/moby/blob/master/pkg/pools
Copyright 2013-2018 Docker, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Contains code adapted from:
https://github.com/moby/moby/blob/master/daemon/internal/system
Copyright 2013-2018 Docker, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Index ¶
- Variables
- func Chtimes(name string, atime time.Time, mtime time.Time) error
- func CopyWithTar(src, dst string, disableIDMapping bool) error
- func CopyWithTarWithRoot(src, dst, dstRoot string, disableIDMapping bool) error
- func LUtimesNano(path string, ts []syscall.Timespec) error
- func Lgetxattr(path string, attr string) ([]byte, error)
- func Lsetxattr(path string, attr string, data []byte, flags int) error
- func UnpackWithRoot(decompressedArchive io.Reader, dest, destRoot string, ...) error
- type BufioReaderPool
- type XattrError
Constants ¶
This section is empty.
Variables ¶
var BufioReader32KPool = newBufioReaderPoolWithSize(buffer32K)
BufioReader32KPool is a pool which returns bufio.Reader with a 32K buffer.
Functions ¶
func Chtimes ¶ added in v4.4.1
Chtimes changes the access time and modified time of a file at the given path. If the modified time is prior to the Unix Epoch (unixMinTime), or after the end of Unix Time (unixEpochTime), os.Chtimes has undefined behavior. In this case, Chtimes defaults to Unix Epoch, just in case.
func CopyWithTar ¶
CopyWithTar is a wrapper around the docker pkg/archive/copy CopyWithTar function allowing unprivileged use. It forces ownership to the current uid/gid in unprivileged situations. No file may be copied into a location above dst, and hard links / symlinks may not target a file above dst.
func CopyWithTarWithRoot ¶ added in v4.1.4
CopyWithTarWithRoots copies files as with CopyWithTar, but uses a custom ar.Untar which checks that hard link / symlink targets are under dstRoot, and not dst. This allows copying a directory src to dst, where the directory contains a link to a location above dst, but under dstroot.
func LUtimesNano ¶ added in v4.4.1
LUtimesNano is used to change access and modification time of the specified path. It's used for symbol link file because unix.UtimesNano doesn't support a NOFOLLOW flag atm.
func Lgetxattr ¶ added in v4.4.1
Lgetxattr retrieves the value of the extended attribute identified by attr and associated with the given path in the file system. It returns a nil slice and nil error if the xattr is not set.
func Lsetxattr ¶ added in v4.4.1
Lsetxattr sets the value of the extended attribute identified by attr and associated with the given path in the file system.
func UnpackWithRoot ¶ added in v4.1.4
func UnpackWithRoot(decompressedArchive io.Reader, dest, destRoot string, options *archive.TarOptions) error
Unpack unpacks the decompressedArchive to dest with options. The target of any symlinks and hard links must be under destRoot. This differs from the unmodified upstream code, which requires that they are under dest.
Types ¶
type BufioReaderPool ¶ added in v4.4.1
type BufioReaderPool struct {
// contains filtered or unexported fields
}
BufioReaderPool is a bufio reader that uses sync.Pool.
func (*BufioReaderPool) Get ¶ added in v4.4.1
func (bufPool *BufioReaderPool) Get(r io.Reader) *bufio.Reader
Get returns a bufio.Reader which reads from r. The buffer size is that of the pool.
func (*BufioReaderPool) Put ¶ added in v4.4.1
func (bufPool *BufioReaderPool) Put(b *bufio.Reader)
Put puts the bufio.Reader back into the pool.
type XattrError ¶ added in v4.4.1
func (*XattrError) Error ¶ added in v4.4.1
func (e *XattrError) Error() string
func (*XattrError) Timeout ¶ added in v4.4.1
func (e *XattrError) Timeout() bool
Timeout reports whether this error represents a timeout.
func (*XattrError) Unwrap ¶ added in v4.4.1
func (e *XattrError) Unwrap() error