Documentation
¶
Overview ¶
Package sql emulates the Cloud SQL Admin API (sqladmin v1beta4 and v1, REST JSON): instances, databases, users, SSL certificates, operations, flags and tiers, with connectSettings and generateEphemeralCert for the connectors. Each instance is a real PostgreSQL, MySQL or SQL Server container, run by the same code as RDS (internal/aws/rds); users and databases are created in the engine. Without Docker the API still answers and nothing runs behind the address.
The instance's PRIMARY ipAddress is "127.0.0.1:<port>": a published container has no fixed port 5432 or 3306, so the address carries it. ponytail: no Cloud SQL Auth Proxy: connect straight to that address (plain TCP, no TLS, no IAM database authentication); the ephemeral certificates are real, signed by the instance's CA, but nothing checks them.
Index ¶
- func Image(databaseVersion string) (image string, ok bool)
- type Service
- func (s *Service) Close() error
- func (s *Service) Info() core.Info
- func (s *Service) Inspect(table, id string) any
- func (s *Service) Load(b []byte) error
- func (s *Service) Reset()
- func (s *Service) Resources() []core.Table
- func (s *Service) Save() ([]byte, error)
- func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the Cloud SQL Admin emulator.
func (*Service) Close ¶
Close removes the containers, except those persisted state resumes next run.
func (*Service) Inspect ¶
Inspect returns an instance (id project/name) with its databases, users and pogi's side: the container, the root password and the note.