Documentation
¶
Index ¶
- func AllModels() []any
- func AsPSQL(f any) any
- func AsPSQLReplica(f any) any
- func FetchGcpCloudSqlPassword(ctx context.Context, _ database) (string, error)
- func FetchIamTokenPassword(ctx context.Context, cfg database) (string, error)
- func New(v *validator.Validate, l zapgorm2.Logger, metricsWriter metrics.Writer, ...) (*gorm.DB, error)
- func NewPSQLMigrator(p PSQLParams, lc fx.Lifecycle) *migrations.Migrator
- func NewReplica(v *validator.Validate, l zapgorm2.Logger, metricsWriter metrics.Writer, ...) (*gorm.DB, error)
- type PSQLParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllModels ¶
func AllModels() []any
declare all models in the correct order they should be migrated.
func AsPSQLReplica ¶ added in v0.19.916
func FetchGcpCloudSqlPassword ¶ added in v0.19.866
FetchGcpCloudSqlPassword fetches a GCP OAuth2 access token for use as the password in Cloud SQL IAM database authentication. The token is obtained via the default credential chain (Workload Identity on GKE).
func FetchIamTokenPassword ¶
FetchIamTokenPassword fetches an iam token which can be used as a password using the default aws credentials provider
func NewPSQLMigrator ¶
func NewPSQLMigrator(p PSQLParams, lc fx.Lifecycle) *migrations.Migrator
func NewReplica ¶ added in v0.19.916
func NewReplica(v *validator.Validate, l zapgorm2.Logger, metricsWriter metrics.Writer, lc fx.Lifecycle, cfg *internal.Config, qc *querycollector.Collector, ) (*gorm.DB, error)
NewReplica errors if DBReplicaHost is empty so callers can't silently fall back to the primary.
Types ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.