NewHeadTailBuffer creates a new HeadTailBuffer with the default head and tail sizes.
()
| 54 | // NewHeadTailBuffer creates a new HeadTailBuffer with the |
| 55 | // default head and tail sizes. |
| 56 | func NewHeadTailBuffer() *HeadTailBuffer { |
| 57 | b := &HeadTailBuffer{ |
| 58 | maxHead: MaxHeadBytes, |
| 59 | maxTail: MaxTailBytes, |
| 60 | } |
| 61 | b.cond = sync.NewCond(&b.mu) |
| 62 | return b |
| 63 | } |
| 64 | |
| 65 | // NewHeadTailBufferSized creates a HeadTailBuffer with custom |
| 66 | // head and tail sizes. This is useful for testing truncation |
no outgoing calls