utils

package
v0.0.0-...-2f5cbfd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2014 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Overview

broadcast package some code from dotcloud/docker

Index

Constants

This section is empty.

Variables

View Source
var ErrTimeout = errors.New("timeout")

Functions

func Debugf

func Debugf(format string, a ...interface{})

func Dump

func Dump(a interface{})

func GoTimeout

func GoTimeout(f func() error, timeout time.Duration) (err error)

func NewBufReader

func NewBufReader(r io.Reader) *bufReader

func NopWriteCloser

func NopWriteCloser(w io.Writer) io.WriteCloser

func TempFile

func TempFile(dir, prefix, suffix string) (name string, err error)

Types

type NameLock

type NameLock struct {
	// contains filtered or unexported fields
}

func NewNameLock

func NewNameLock(name string) *NameLock

func (*NameLock) Lock

func (l *NameLock) Lock()

func (*NameLock) Unlock

func (l *NameLock) Unlock()

type NopWriter

type NopWriter struct{}

nop writer

func (*NopWriter) Write

func (*NopWriter) Write(buf []byte) (int, error)

type SafeMap

type SafeMap struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewSafeMap

func NewSafeMap() *SafeMap

func (*SafeMap) Del

func (this *SafeMap) Del(key string)

func (*SafeMap) Get

func (this *SafeMap) Get(key string) (v interface{})

func (*SafeMap) Set

func (this *SafeMap) Set(key string, v interface{})

type StreamWriter

type StreamWriter struct {
	// contains filtered or unexported fields
}

type WriteBroadcaster

type WriteBroadcaster struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewWriteBroadcaster

func NewWriteBroadcaster() *WriteBroadcaster

func (*WriteBroadcaster) AddWriter

func (w *WriteBroadcaster) AddWriter(writer io.WriteCloser, stream string)

func (*WriteBroadcaster) Bytes

func (wb *WriteBroadcaster) Bytes() []byte

func (*WriteBroadcaster) CloseWriters

func (w *WriteBroadcaster) CloseWriters() error

func (*WriteBroadcaster) Closed

func (wb *WriteBroadcaster) Closed() bool

func (*WriteBroadcaster) NewReader

func (wb *WriteBroadcaster) NewReader(name string) ([]byte, *io.PipeReader)

func (*WriteBroadcaster) Write

func (w *WriteBroadcaster) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL