cache/cache.go
func New() *Cache {
	c := &Cache{
		data:          make([]*Shard, shardCount),
		writeStrategy: Noop,
	}

	for i := 0; i < shardCount; i++ {
		c.data[i] = &Shard{
			items:        make(map[string]*points.Points),
			notConfirmed: make([]*points.Points, 4),
		}
	}

	settings := cacheSettings{
		maxSize:     1000000,
		tagsEnabled: false,
		xlog:        nil,
	}

	c.settings.Store(&settings)

	c.writeoutQueue = NewWriteoutQueue(c)
	return c
}
func New() *Cache {
	c := &Cache{
		data:          make([]*Shard, shardCount),
		writeStrategy: Noop,
	}

	for i := 0; i < shardCount; i++ {
		c.data[i] = &Shard{
			items:        make(map[string]*points.Points),
			notConfirmed: make([]*points.Points, 4),
		}
	}

	settings := cacheSettings{
		maxSize:     1000000,
		tagsEnabled: false,
		xlog:        nil,
	}

	c.settings.Store(&settings)

	c.writeoutQueue = NewWriteoutQueue(c)
	return c
}
func New ( ) * Cache { c := & Cache { data : make ( [ ] * Shard , shardCount ) , writeStrategy : Noop , } for i := 0 ; i < shardCount ; i ++ { c . data [ i ] = & Shard { items : make ( map [ string ] * points . Points ) , notConfirmed : make ( [ ] * points . Points , 4 ) , } } settings := cacheSettings { maxSize : 1000000 , tagsEnabled : false , xlog : nil , } c . settings . Store ( & settings ) c . writeoutQueue = NewWriteoutQueue ( c ) return c }
// Creates a new cache instance
Creates a new cache instance