func ForDataset(spec string) (Spec, error) {
	return ForDatasetOpts(spec, SpecOptions{})
}
ForDataset parses a spec for a Dataset.
package spec
import (
	"errors"
	"fmt"
	"net/url"
	"os"
	"regexp"
	"strings"
	"github.com/attic-labs/noms/go/chunks"
	"github.com/attic-labs/noms/go/d"
	"github.com/attic-labs/noms/go/datas"
	"github.com/attic-labs/noms/go/nbs"
	"github.com/attic-labs/noms/go/types"
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/dynamodb"
	"github.com/aws/aws-sdk-go/service/s3"
)
const Separator = "::"
var datasetRe = regexp.MustCompile("^" + datas.DatasetRe.String() + "$")
var GetAWSSession func() *session.Session = func() *session.Session {
	return session.Must(session.NewSession(aws.NewConfig().WithRegion("us-west-2")))
}
type ProtocolImpl interface {
	NewChunkStore(sp Spec) (chunks.ChunkStore, error)
	NewDatabase(sp Spec) (datas.Database, error)
}
var ExternalProtocols = map[string]ProtocolImpl{}
type SpecOptions struct {
	Authorization string
}
type Spec struct {
	Protocol string
	DatabaseName string
	Options SpecOptions
	Path AbsolutePath
	db *datas.Database
}
func newSpec(dbSpec string, opts SpecOptions) (Spec, error) {
	protocol, dbName, err := parseDatabaseSpec(dbSpec)
	if err != nil {
		return Spec{}, err
	}
	return Spec{
		Protocol:     protocol,
		DatabaseName: dbName,
		Options:      opts,
		db:           new(datas.Database),
	}, nil
}
func ForDatabase(spec string) (Spec, error) {
	return ForDatabaseOpts(spec, SpecOptions{})
}
func ForDatabaseOpts(spec string, opts SpecOptions) (Spec, error) {
	return newSpec(spec, opts)
}