GoogleCloudPlatform / GoogleCloudPlatform/cloud-sql-nodejs-connector

Align class names and code structure with the connectors in other languages

Abierto
#341 0 comentarios 1 reacción 1 asignado Asignado a @hessjcg Ver en GitHub
priority: p2 type: feature request
Lenguaje dominante
TypeScript
Estrellas
97
Forks
16
Merge medio
4 d 16 h
PR fusionados (30 d)
4

Descripción

The connectors in the other languages are structured with common names and separation of concerns.

Public API:
- `Connector` is the main public API to configure and connect.
- `ConnectionOptions` is the value object containing connection options. main public API to configure and connect.

Internal API:
- `ConnectorRegistry` is the internal class that holds configuration and caches for each database instance.
- `ConnectionInfo` is a value object that holds the configuration and data for one database instance.
- `ConnectionInfoCache` interface holds the active `ConnectionInfo` value for a single database instance and keeps it up to date, refreshing the data as needed.
- `RefreshAheadCache` implements the `ConnectionInfoCache` using the current connector refresh algorithm
- `LazyRefreshCache` (to be added with #285) implements `ConnectionInfoCache` using the lazy refresh algorithm.
- `ConnectionInfoRepository` calls the Cloud SQL Admin API to build an up-to-date `ConnectionInfo` object.

To get to the NodeJS connector codebase into state, we will need to move some code and rename some classes.
- Rename `CloudSQLInstanceMap` to `ConnectorRegistry`
- Rename `InstanceConnectionInfo` to `ConnectionInfo`
- Rename `CloudSQLInstance` class to `RefreshAheadCache`
- Rename `Fetcher` interface to `ConnectionInfoRepository`
- Rename `SqlAdminFetcher` class to `DefaultConnectionInfoRepository`

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.