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

Đang mở
#341 0 bình luận 1 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@hessjcg đang làm issue này rồi.

Từ ngày 30/4/2024.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

priority: p2 type: feature request

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
Ngôn ngữ chính
TypeScript
Star
99
Fork
18
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
20

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của GoogleCloudPlatform/cloud-sql-nodejs-connector

Tất cả issue của GoogleCloudPlatform/cloud-sql-nodejs-connector

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.