func (cs *ChainSet) Get(name string) (*chain, bool) {
	if _, ok := cs.Cmap[name]; !ok {
		return nil, false
	}
	return cs.Cmap[name], true
}
Get returns the chain corresponding to the passed name. It returns
false if the chain is not found in the Cmap. This can be the case if the
chain has been deleted by the Run() in order to save the memory resources.
package file
import (
	"encoding/json"
	"fmt"
	"os"
	"runtime"
	"strings"
	"sync"
	"time"
)
var Chains *ChainSet
func init() {
	Chains = NewChainSet(FlushAsTime, time.Second*10)
	Chains.Run()
}
const (
	BlockDataSeparator = "|"
	FileExtension = ".json"
)
const (
	FlushAsTime = 0
	FlushAsSpace = 1
)
type ChainSet struct {
	FlushDuration time.Duration
	flushType     int
	Cmap          map[string]*chain
	cancel        chan interface{}
	mux           sync.RWMutex
}
func NewChainSet(flushType int, flushDuration time.Duration) *ChainSet {
	return &ChainSet{
		FlushDuration: flushDuration,
		flushType:     flushType,
		Cmap:          make(map[string]*chain),
		cancel:        make(chan interface{}),
	}
}
func (cs *ChainSet) Cancel() {
	cs.cancel <- ""
}