56 lines
1.6 KiB
Markdown
56 lines
1.6 KiB
Markdown
|
|
# v1.0.0
|
||
|
|
|
||
|
|
> `code.nochebuena.dev/go/firebase`
|
||
|
|
|
||
|
|
## Overview
|
||
|
|
|
||
|
|
`firebase` manages the lifecycle of a `firebase.google.com/go/v4` App: validates
|
||
|
|
configuration at init time, initialises the SDK App, exposes the native `*firebase.App`
|
||
|
|
to consumers, and performs health checks by probing the Firebase Auth service.
|
||
|
|
|
||
|
|
v1.0.0 caches the `auth.Client` inside the component (eliminating per-probe allocation),
|
||
|
|
adopts `xerrors` for all structured error returns, bumps all micro-lib dependencies to v1,
|
||
|
|
and commits the API as stable.
|
||
|
|
|
||
|
|
## What Changed Since v0.9.0
|
||
|
|
|
||
|
|
### Auth client cached in `OnInit`
|
||
|
|
|
||
|
|
`OnInit` now calls `app.Auth(context.Background())` once and stores the result on the
|
||
|
|
component. `HealthCheck` uses the cached client directly — no per-probe `app.Auth(ctx)`
|
||
|
|
call.
|
||
|
|
|
||
|
|
### Structured errors via `xerrors`
|
||
|
|
|
||
|
|
All `fmt.Errorf` calls replaced with `xerrors`:
|
||
|
|
|
||
|
|
| Situation | Code |
|
||
|
|
|-----------|------|
|
||
|
|
| `ProjectID` empty | `ErrInvalidInput` |
|
||
|
|
| `fb.NewApp` fails | `ErrInternal` (wraps SDK error) |
|
||
|
|
| `app.Auth` fails | `ErrInternal` (wraps SDK error) |
|
||
|
|
| `HealthCheck` before `OnInit` | `ErrInternal` |
|
||
|
|
|
||
|
|
### Dependency updates
|
||
|
|
|
||
|
|
- `health`, `launcher`, `logz` bumped from `v0.9.x` to `v1.0.1`
|
||
|
|
- `xerrors v1.0.1` added as direct dependency
|
||
|
|
- Go directive bumped from `1.25` to `1.26`
|
||
|
|
|
||
|
|
## Full API (stable)
|
||
|
|
|
||
|
|
- `Config` — `ProjectID string` (`FIREBASE_PROJECT_ID`, required)
|
||
|
|
- `Provider` — `App() *fb.App`
|
||
|
|
- `Component` — embeds `launcher.Component` + `health.Checkable` + `Provider`
|
||
|
|
- `New(logger, cfg) Component`
|
||
|
|
|
||
|
|
## Installation
|
||
|
|
|
||
|
|
```
|
||
|
|
go get code.nochebuena.dev/go/firebase@v1.0.0
|
||
|
|
```
|
||
|
|
|
||
|
|
## Changelog
|
||
|
|
|
||
|
|
See [CHANGELOG.md](CHANGELOG.md#100---2026-05-12).
|