gocloud.devgocloud.dev/mysql/azuremysql Index | Files

package azuremysql

import "gocloud.dev/mysql/azuremysql"

Package azuremysql provides connections to Azure Database for MySQL. See https://docs.microsoft.com/en-us/azure/mysql.

Index

Functions

func Open

func Open(ctx context.Context, cp CertPoolProvider, params *Params) (*sql.DB, func(), error)

Open opens an encrypted connection to an Azure Database for MySql database.

Types

type CertFetcher

type CertFetcher = azuredb.AzureCertFetcher

CertFetcher is a default CertPoolProvider that can fetch CA certificates from any publicly accessible URI or File.

type CertPoolProvider

type CertPoolProvider = azuredb.CertPoolProvider

A CertPoolProvider obtains a certificate pool that contains the Azure CA certificate.

type Params

type Params struct {
	// ServerName is the MYSQL instance name without domain suffix. Example: gocloud
	ServerName string
	// User is the database user to connect as.
	User string
	// Password is the database user password to use.
	Password string
	// Database is the MYSQL database name to connect to.
	Database string
	// TraceOpts contains options for OpenCensus.
	TraceOpts []ocsql.TraceOption
}

Params specifies how to connect to an Azure Database for MySQL.

func (*Params) GetFQDN

func (p *Params) GetFQDN() string

GetFQDN constructs the FQDN for Azure Database for MySQL.

func (*Params) Validate

func (p *Params) Validate() error

Validate ensures all required parameters are set.

Source Files

azuremysql.go

Version
v0.15.0
Published
May 30, 2019
Platform
windows/amd64
Imports
8 packages
Last checked
36 minutes ago

Tools for package owners.