1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-18 22:17:44 +02:00

Added debug.Logger interface

This commit is contained in:
Milos Gajdos
2019-11-27 16:02:16 +00:00
parent 3f7f2afc7b
commit ee9776e7b2
5 changed files with 278 additions and 7 deletions

View File

@ -17,6 +17,14 @@ type Entry struct {
Timestamp time.Time
}
// New returns a new buffer of the given size
func New(i int) *Buffer {
return &Buffer{
size: i,
}
}
// Put adds a new value to ring buffer
func (b *Buffer) Put(v interface{}) {
b.Lock()
defer b.Unlock()
@ -83,13 +91,7 @@ func (b *Buffer) Since(t time.Time) []*Entry {
return nil
}
// Size returns the size of the ring buffer
func (b *Buffer) Size() int {
return b.size
}
// New returns a new buffer of the given size
func New(i int) *Buffer {
return &Buffer{
size: i,
}
}