package utils
import "github.com/docker/docker/utils"
Index ¶
- func CheckLocalDns() bool
- func CompareKernelVersion(a, b *KernelVersionInfo) int
- func CopyDirectory(source, dest string) error
- func CopyEscapable(dst io.Writer, src io.ReadCloser) (written int64, err error)
- func Debugf(format string, a ...interface{})
- func Download(url string, stderr io.Writer) (*http.Response, error)
- func FindCgroupMountpoint(cgroupType string) (string, error)
- func GetTotalUsedFds() int
- func Go(f func() error) chan error
- func HashData(src io.Reader) (string, error)
- func HumanDuration(d time.Duration) string
- func HumanSize(size int64) string
- func IsGIT(str string) bool
- func IsURL(str string) bool
- func NewBufReader(r io.Reader) *bufReader
- func NopWriteCloser(w io.Writer) io.WriteCloser
- func ParseHost(host string, port int, addr string) string
- func ProgressReader(r io.ReadCloser, size int, output io.Writer, template []byte, sf *StreamFormatter) *progressReader
- func SelfPath() string
- func Trunc(s string, maxlen int) string
- func TruncateID(id string) string
- type JSONMessage
- type KernelVersionInfo
- type NopFlusher
- type NopWriter
- type StreamFormatter
- func NewStreamFormatter(json bool) *StreamFormatter
- func (sf *StreamFormatter) FormatError(err error) []byte
- func (sf *StreamFormatter) FormatProgress(action, str string) []byte
- func (sf *StreamFormatter) FormatStatus(format string, a ...interface{}) []byte
- func (sf *StreamFormatter) Used() bool
- type TruncIndex
- func NewTruncIndex() *TruncIndex
- func (idx *TruncIndex) Add(id string) error
- func (idx *TruncIndex) Delete(id string) error
- func (idx *TruncIndex) Get(s string) (string, error)
- type WriteBroadcaster
- func NewWriteBroadcaster() *WriteBroadcaster
- func (w *WriteBroadcaster) AddWriter(writer io.WriteCloser)
- func (w *WriteBroadcaster) CloseWriters() error
- func (w *WriteBroadcaster) RemoveWriter(writer io.WriteCloser)
- func (w *WriteBroadcaster) Write(p []byte) (n int, err error)
- type WriteFlusher
Functions ¶
func CheckLocalDns ¶
func CheckLocalDns() bool
func CompareKernelVersion ¶
func CompareKernelVersion(a, b *KernelVersionInfo) int
Compare two KernelVersionInfo struct. Returns -1 if a < b, = if a == b, 1 it a > b
func CopyDirectory ¶
FIXME: this is deprecated by CopyWithTar in archive.go
func CopyEscapable ¶
Code c/c from io.Copy() modified to handle escape sequence
func Debugf ¶
func Debugf(format string, a ...interface{})
Debug function, if the debug flag is set, then display. Do nothing otherwise If Docker is in damon mode, also send the debug info on the socket
func Download ¶
Request a given URL and return an io.Reader
func FindCgroupMountpoint ¶
func GetTotalUsedFds ¶
func GetTotalUsedFds() int
func Go ¶
Go is a basic promise implementation: it wraps calls a function in a goroutine, and returns a channel which will later return the function's return value.
func HashData ¶
func HumanDuration ¶
HumanDuration returns a human-readable approximation of a duration (eg. "About a minute", "4 hours ago", etc.)
func HumanSize ¶
HumanSize returns a human-readable approximation of a size using SI standard (eg. "44kB", "17MB")
func IsGIT ¶
func IsURL ¶
func NewBufReader ¶
func NopWriteCloser ¶
func NopWriteCloser(w io.Writer) io.WriteCloser
func ParseHost ¶
func ProgressReader ¶
func ProgressReader(r io.ReadCloser, size int, output io.Writer, template []byte, sf *StreamFormatter) *progressReader
func SelfPath ¶
func SelfPath() string
Figure out the absolute path of our own binary
func Trunc ¶
func TruncateID ¶
TruncateID returns a shorthand version of a string identifier for convenience. A collision with other shorthands is very unlikely, but possible. In case of a collision a lookup with TruncIndex.Get() will fail, and the caller will need to use a langer prefix, or the full-length Id.
Types ¶
type JSONMessage ¶
type JSONMessage struct { Status string `json:"status,omitempty"` Progress string `json:"progress,omitempty"` Error string `json:"error,omitempty"` }
type KernelVersionInfo ¶
func GetKernelVersion ¶
func GetKernelVersion() (*KernelVersionInfo, error)
func (*KernelVersionInfo) String ¶
func (k *KernelVersionInfo) String() string
type NopFlusher ¶
type NopFlusher struct{}
func (*NopFlusher) Flush ¶
func (f *NopFlusher) Flush()
type NopWriter ¶
type NopWriter struct { }
func (*NopWriter) Write ¶
type StreamFormatter ¶
type StreamFormatter struct {
// contains filtered or unexported fields
}
func NewStreamFormatter ¶
func NewStreamFormatter(json bool) *StreamFormatter
func (*StreamFormatter) FormatError ¶
func (sf *StreamFormatter) FormatError(err error) []byte
func (*StreamFormatter) FormatProgress ¶
func (sf *StreamFormatter) FormatProgress(action, str string) []byte
func (*StreamFormatter) FormatStatus ¶
func (sf *StreamFormatter) FormatStatus(format string, a ...interface{}) []byte
func (*StreamFormatter) Used ¶
func (sf *StreamFormatter) Used() bool
type TruncIndex ¶
type TruncIndex struct {
// contains filtered or unexported fields
}
TruncIndex allows the retrieval of string identifiers by any of their unique prefixes. This is used to retrieve image and container IDs by more convenient shorthand prefixes.
func NewTruncIndex ¶
func NewTruncIndex() *TruncIndex
func (*TruncIndex) Add ¶
func (idx *TruncIndex) Add(id string) error
func (*TruncIndex) Delete ¶
func (idx *TruncIndex) Delete(id string) error
func (*TruncIndex) Get ¶
func (idx *TruncIndex) Get(s string) (string, error)
type WriteBroadcaster ¶
type WriteBroadcaster struct {
// contains filtered or unexported fields
}
func NewWriteBroadcaster ¶
func NewWriteBroadcaster() *WriteBroadcaster
func (*WriteBroadcaster) AddWriter ¶
func (w *WriteBroadcaster) AddWriter(writer io.WriteCloser)
func (*WriteBroadcaster) CloseWriters ¶
func (w *WriteBroadcaster) CloseWriters() error
func (*WriteBroadcaster) RemoveWriter ¶
func (w *WriteBroadcaster) RemoveWriter(writer io.WriteCloser)
FIXME: Is that function used? FIXME: This relies on the concrete writer type used having equality operator
func (*WriteBroadcaster) Write ¶
func (w *WriteBroadcaster) Write(p []byte) (n int, err error)
type WriteFlusher ¶
type WriteFlusher struct {
// contains filtered or unexported fields
}
func NewWriteFlusher ¶
func NewWriteFlusher(w io.Writer) *WriteFlusher
func (*WriteFlusher) Write ¶
func (wf *WriteFlusher) Write(b []byte) (n int, err error)
Source Files ¶
- Version
- v0.4.5
- Published
- Jun 22, 2013
- Platform
- windows/amd64
- Imports
- 19 packages
- Last checked
- 51 minutes ago –
Tools for package owners.