Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoPrimaryAddress = errors.New("no primary address found for database")
ErrNoPrimaryAddress is returned when a database does not have a valid primary address.
Functions ¶
This section is empty.
Types ¶
type GCloudProvider ¶
type GCloudProvider struct {
// contains filtered or unexported fields
}
GCloudProvider is a configuration provider for Google Cloud managed databases.
func (*GCloudProvider) GetAuthorityCertificate ¶
func (p *GCloudProvider) GetAuthorityCertificate() (*x509.Certificate, error)
GetAuthorityCertificate returns the latest root certificate authority.
func (*GCloudProvider) GetClientCertificate ¶
func (p *GCloudProvider) GetClientCertificate() (*tls.Certificate, error)
GetClientCertificate returns the latest ephemeral client certificate.
func (*GCloudProvider) GetPrimaryAddress ¶
func (p *GCloudProvider) GetPrimaryAddress() (string, error)
GetPrimaryAddress returns the active primary ip address of the database (eg. its public load balancer).
func (*GCloudProvider) RefreshConfig ¶
func (p *GCloudProvider) RefreshConfig() error
RefreshConfig downloads the latest database configuration and issues an updated client certificate.
type Provider ¶
type Provider interface { GetPrimaryAddress() (string, error) GetClientCertificate() (*tls.Certificate, error) GetAuthorityCertificate() (*x509.Certificate, error) RefreshConfig() error }
Provider is a cached configuration provider. We cache the database configuration so that we don't spam the Google Cloud API and use excess API quota.