func (data *Data) Database(name string) *DatabaseInfo {
	for i := range data.Databases {
		if data.Databases[i].Name == name {
			return &data.Databases[i]
		}
	}
	return nil
}
Database returns a DatabaseInfo by the database name.
package meta
import (
	"errors"
	"net"
	"net/url"
	"sort"
	"strings"
	"sync"
	"time"
	"unicode"
	"fmt"
	"github.com/gogo/protobuf/proto"
	"github.com/influxdata/influxdb"
	"github.com/influxdata/influxdb/models"
	"github.com/influxdata/influxdb/query"
	internal "github.com/influxdata/influxdb/services/meta/internal"
	"github.com/influxdata/influxql"
)
const (
	DefaultRetentionPolicyReplicaN = 1
	DefaultRetentionPolicyDuration = time.Duration(0)
	DefaultRetentionPolicyName = "autogen"
	MinRetentionPolicyDuration = time.Hour
)
type Data struct {
	Term      uint64  
	Index     uint64  
	ClusterID uint64
	Databases []DatabaseInfo
	Users     []UserInfo
	adminUserExists bool
	MaxShardGroupID uint64
	MaxShardID      uint64
}