Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadWithTimeout ¶
func ReadWithTimeout(ch <-chan (interface{}), timeoutMillis time.Duration) (val interface{}, err error)
reads 1 element from the channel with a timeout. unfortunately this piece of code is pretty useless in it's generalized form you can use a chan X as a chan interface{}, you need another chan to wrap it -_-g
Types ¶
type CircularBuf ¶
type CircularBuf struct {
// contains filtered or unexported fields
}
a a circular byte buffer
func NewCircularBuf ¶
func NewCircularBuf(capacity int) *CircularBuf
func (*CircularBuf) Capacity ¶
func (b *CircularBuf) Capacity() int
func (*CircularBuf) GimmeBuf ¶
func (b *CircularBuf) GimmeBuf() []byte
func (*CircularBuf) Read ¶
func (b *CircularBuf) Read(p []byte) (bytesCopied int, err error)
the read consumes the buffer
func (*CircularBuf) Size ¶
func (b *CircularBuf) Size() int
Click to show internal directories.
Click to hide internal directories.