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(root *os.Root, name string, atime time.Time, mtime time.Time) error
- func CopyWithTar(src, dst string, disableIDMapping bool) error
- func CopyWithTarWithRoot(src, dst, root 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
- 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, resolved relative to root. 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 archive entries may be written above dst. Hard links to files outside of dst are not allowed. Relative symlinks to targets outside of dst are not allowed. Absolute symlink targets are allowed, but will not be traversed outside of dst when extracting entries.
func CopyWithTarWithRoot ¶ added in v4.1.4
CopyWithTarWithRoots copies files as with CopyWithTar, but uses a custom ar.Untar rooted at root, and not dst. This allows copying from src to dst, where this will create a hard link or symlink 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.
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