func (k Key) Scopes(scopes ...string) Key {
	k.scopes = scopes
	return k
}
Scopes of the key
package lcw
import (
	"strings"
	"github.com/pkg/errors"
)
type Scache struct {
	lc LoadingCache
}
func NewScache(lc LoadingCache) *Scache {
	return &Scache{lc: lc}
}
func (m *Scache) Get(key Key, fn func() ([]byte, error)) (data []byte, err error) {
	keyStr := key.String()
	val, err := m.lc.Get(keyStr, func() (value interface{}, e error) {
		return fn()
	})
	return val.([]byte), err
}
func (m *Scache) Stat() CacheStat {
	return m.lc.Stat()
}
func (m *Scache) Close() error {
	return m.lc.Close()
}
func (m *Scache) Flush(req FlusherRequest) {
	if len(req.scopes) == 0 {
		m.lc.Purge()
		return
	}
	inScope := func(fullKey string) bool {
		key, err := parseKey(fullKey)
		if err != nil {
			return false
		}
		for _, s := range req.scopes {
			for _, ks := range key.scopes {
				if ks == s {
					return true
				}
			}
		}
		return false
	}
	for _, k := range m.lc.Keys() {
		if inScope(k) {
			m.lc.Delete(k)  
		}
	}
}
type Key struct {
	id        string    
	partition string    
	scopes    []string  
}
func NewKey(partition ...string) Key {
	if len(partition) == 0 {
		return Key{partition: ""}
	}
	return Key{partition: partition[0]}
}
func (k Key) ID(id string) Key {
	k.id = id
	return k
}