Documentation ¶
Index ¶
- Constants
- Variables
- func CreateDB(ctx context.Context, nbf *types.NomsBinFormat, urlStr string, ...) (datas.Database, types.ValueReadWriter, error)
- type AWSCredentialSource
- type AWSFactory
- type DBFactory
- type DoltRemoteFactory
- type FileFactory
- type GRPCDialProvider
- type GSFactory
- type LocalBSFactory
- type MemFactory
Constants ¶
const ( // AWSRegionParam is a creation parameter that can be used to set the AWS region AWSRegionParam = "aws-region" // AWSCredsTypeParam is a creation parameter that can be used to set the type of credentials that should be used. // valid values are role, env, auto, and file AWSCredsTypeParam = "aws-creds-type" // AWSCredsFileParam is a creation parameter that can be used to specify a credential file to use. AWSCredsFileParam = "aws-creds-file" //AWSCredsProfile is a creation parameter that can be used to specify which AWS profile to use. AWSCredsProfile = "aws-creds-profile" )
const ( // AWSScheme AWSScheme = "aws" // GSScheme GSScheme = "gs" // FileScheme FileScheme = "file" // MemScheme MemScheme = "mem" // HTTPSScheme HTTPSScheme = "https" // HTTPScheme HTTPScheme = "http" // InMemBlobstore Scheme LocalBSScheme = "localbs" )
const ( // DoltDir defines the directory used to hold the dolt repo data within the filesys DoltDir = ".dolt" // DataDir is the directory internal to the DoltDir which holds the noms files. DataDir = "noms" )
Variables ¶
var AWSCredTypes = []string{RoleCS.String(), EnvCS.String(), FileCS.String()}
var DBFactories = map[string]DBFactory{ AWSScheme: AWSFactory{}, GSScheme: GSFactory{}, FileScheme: FileFactory{}, MemScheme: MemFactory{}, LocalBSScheme: LocalBSFactory{}, HTTPScheme: NewDoltRemoteFactory(true), HTTPSScheme: NewDoltRemoteFactory(false), }
DBFactories is a map from url scheme name to DBFactory. Additional factories can be added to the DBFactories map from external packages.
var DoltDataDir = filepath.Join(DoltDir, DataDir)
DoltDataDir is the directory where noms files will be stored
var GRPCDialProviderParam = "__DOLT__grpc_dial_provider"
var NoCachingParameter = "__dolt__NO_CACHING"
Functions ¶
func CreateDB ¶
func CreateDB(ctx context.Context, nbf *types.NomsBinFormat, urlStr string, params map[string]interface{}) (datas.Database, types.ValueReadWriter, error)
CreateDB creates a database based on the supplied urlStr, and creation params. The DBFactory used for creation is determined by the scheme of the url. Naked urls will use https by default.
Types ¶
type AWSCredentialSource ¶
type AWSCredentialSource int
AWSCredentialSource is an enum type representing the different credential sources (auto, role, env, file, or invalid)
const ( InvalidCS AWSCredentialSource = iota - 1 // Auto will try env first and fall back to role (This is the default) AutoCS // Role Uses the AWS IAM role of the instance for auth RoleCS // Env uses the credentials stored in the environment variables AWS_ACCESS_KEY_ID, and AWS_SECRET_ACCESS_KEY EnvCS // Uses credentials stored in a file FileCS )
func AWSCredentialSourceFromStr ¶
func AWSCredentialSourceFromStr(str string) AWSCredentialSource
AWSCredentialSourceFromStr converts a string to an AWSCredentialSource
func (AWSCredentialSource) String ¶
func (ct AWSCredentialSource) String() string
String returns the string representation of the of an AWSCredentialSource
type AWSFactory ¶
type AWSFactory struct { }
AWSFactory is a DBFactory implementation for creating AWS backed databases
func (AWSFactory) CreateDB ¶
func (fact AWSFactory) CreateDB(ctx context.Context, nbf *types.NomsBinFormat, urlObj *url.URL, params map[string]interface{}) (datas.Database, types.ValueReadWriter, error)
CreateDB creates an AWS backed database
type DBFactory ¶
type DBFactory interface {
CreateDB(ctx context.Context, nbf *types.NomsBinFormat, urlObj *url.URL, params map[string]interface{}) (datas.Database, types.ValueReadWriter, error)
}
DBFactory is an interface for creating concrete datas.Database instances which may have different backing stores.
type DoltRemoteFactory ¶
type DoltRemoteFactory struct {
// contains filtered or unexported fields
}
DoldRemoteFactory is a DBFactory implementation for creating databases backed by a remote server that implements the GRPC rpcs defined by remoteapis.ChunkStoreServiceClient
func NewDoltRemoteFactory ¶
func NewDoltRemoteFactory(insecure bool) DoltRemoteFactory
NewDoltRemoteFactory creates a DoltRemoteFactory instance using the given GRPCConnectionProvider, and insecure setting
func (DoltRemoteFactory) CreateDB ¶
func (fact DoltRemoteFactory) CreateDB(ctx context.Context, nbf *types.NomsBinFormat, urlObj *url.URL, params map[string]interface{}) (datas.Database, types.ValueReadWriter, error)
CreateDB creates a database backed by a remote server that implements the GRPC rpcs defined by remoteapis.ChunkStoreServiceClient
type FileFactory ¶
type FileFactory struct { }
FileFactory is a DBFactory implementation for creating local filesys backed databases
func (FileFactory) CreateDB ¶
func (fact FileFactory) CreateDB(ctx context.Context, nbf *types.NomsBinFormat, urlObj *url.URL, params map[string]interface{}) (datas.Database, types.ValueReadWriter, error)
CreateDB creates an local filesys backed database
type GRPCDialProvider ¶
type GRPCDialProvider interface {
GetGRPCDialParams(grpcendpoint.Config) (string, []grpc.DialOption, error)
}
GRPCDialProvider is an interface for getting a *grpc.ClientConn.
type GSFactory ¶
type GSFactory struct { }
GSFactory is a DBFactory implementation for creating GCS backed databases
type LocalBSFactory ¶
type LocalBSFactory struct { }
LocalBSFactory is a DBFactory implementation for creating a local filesystem blobstore backed databases for testing
func (LocalBSFactory) CreateDB ¶
func (fact LocalBSFactory) CreateDB(ctx context.Context, nbf *types.NomsBinFormat, urlObj *url.URL, params map[string]interface{}) (datas.Database, types.ValueReadWriter, error)
CreateDB creates a local filesystem blobstore backed database
type MemFactory ¶
type MemFactory struct { }
MemFactory is a DBFactory implementation for creating in memory backed databases
func (MemFactory) CreateDB ¶
func (fact MemFactory) CreateDB(ctx context.Context, nbf *types.NomsBinFormat, urlObj *url.URL, params map[string]interface{}) (datas.Database, types.ValueReadWriter, error)
CreateDB creates an in memory backed database