func NewClient(config *meta.Config) *Client {
	return &Client{
		cacheData: &Data{
			Data: meta.Data{
				ClusterID: 0,
				Index:     1,
			},
		},
		closing:             make(chan struct{}),
		changed:             make(chan struct{}),
		logger:              zap.NewNop(),
		authCache:           make(map[string]authUser),
		path:                config.Dir,
		retentionAutoCreate: config.RetentionAutoCreate,
	}
}
NewClient returns a new *Client.
package meta
import (
	"bytes"
	crand "crypto/rand"
	"crypto/sha256"
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"os"
	"path/filepath"
	"sort"
	"sync"
	"time"
	"github.com/influxdata/influxdb"
	"github.com/influxdata/influxdb/logger"
	"github.com/influxdata/influxdb/pkg/file"
	"github.com/influxdata/influxdb/services/meta"
	"github.com/influxdata/influxql"
	"go.uber.org/zap"
	"golang.org/x/crypto/bcrypt"
)
const (
	SaltBytes = 32
	metaFile = "meta.db"
	ShardGroupDeletedExpiration = -2 * 7 * 24 * time.Hour
)
type Client struct {
	logger *zap.Logger
	mu        sync.RWMutex
	closing   chan struct{}
	changed   chan struct{}
	cacheData *Data
	authCache map[string]authUser
	path string
	retentionAutoCreate bool
}
type authUser struct {
	bhash string
	salt  []byte
	hash  []byte
}