Releases: flashcatcloud/go-flashduty
v0.3.0 — human-readable response timestamps
Highlights
Response time fields now read as RFC3339 in JSON, logs, and LLM-facing output instead of opaque integers — ported from flashduty-sdk.
- New
Timestamp(Unix seconds) andTimestampMilli(milliseconds) types, bothint64-based:MarshalJSON→ quoted RFC3339 in the local timezone.UnmarshalJSONaccepts either a numeric epoch or an RFC3339 string, so values round-trip cleanly.- Zero value stays the numeric
0sentinel (never a 1970 date) and is dropped byomitempty. String()forfmt/TOON output;Unix(),Time(),IsZero()accessors.
- The generator detects epoch-timestamp fields by their spec description (unix/epoch/timestamp + second/milli, excluding duration/offset/elapsed) — not by name, which is an unreliable proxy.
- Conversion is response-only: fields in request-reachable schemas keep
int64, because a request marshals to the wire where the API wants a numeric epoch. 114 response fields converted; every request struct keepsint64. Verified live against the API.
⚠️ Breaking change
Response time fields change from int64 to Timestamp or TimestampMilli. Migrate with .Unix() for the raw epoch or .Time() for a time.Time.
inc := list.Items[0]
fmt.Println(inc.StartTime) // 2026-05-30T14:37:11+08:00
epoch := inc.StartTime.Unix() // 1779514631 (raw wire value)
t := inc.StartTime.Time() // time.TimeFull Changelog: v0.2.1...v0.3.0
v0.2.1 — docs cleanup
Patch release: removes the remaining google/go-github references from package and code comments (notably the retry package doc shown on pkg.go.dev and the generated service-backing comment). No API or behavior changes.
v0.2.0 — live-validated; retry rename; lint toolchain
First release validated end-to-end against the live Flashduty API, now with a lint/format toolchain and a couple of breaking refinements.
Breaking changes
- Retry transport moved. The
flashdutyretrysubpackage is nowretry. Update imports togithub.com/flashcatcloud/go-flashduty/retryand construct withretry.New(...). - Rule-counter responses are maps. Endpoints returning a channel/node → count object now decode into
map[string]int64(RuleCounterChannelResponse/RuleCounterNodeResponse) instead of an empty struct.
Added
Response.Rawexposes the raw body for endpoints that return non-JSON payloads (e.g. CSV exports) instead of failing envelope decoding.- Env-gated live E2E suite (
make e2e) covering reads, search-after pagination, and a full team create → read → update → delete write lifecycle. - golangci-lint v2 + gofmt/gci toolchain (
make lint/make fmt) plus a CI lint job, mirroring the flashcatcloud org convention.
Changed
- README and package docs describe the SDK on its own terms and link the official English API reference.
v0.1.1 — codegen correctness
Patch release hardening the generated type layer.
A new spec-example round-trip test decodes every endpoint's vendored response example (135 endpoints) into its generated Go type — through the same envelope→data path the client uses. It surfaced three generator type-resolution bugs, now fixed at the root:
- Nullable unions (
type: ["integer", "null"]) resolved tomap[string]anyinstead of the underlying type. Nullable IDs are nowint64, nullable arrays are typed slices, etc. - Pure
$refschemas (e.g.FilterGroup = {$ref: OrFilterGroup}) were emitted as empty structs instead of type aliases. oneOf/anyOfpolymorphic values (e.g.default_value: bool|string|[]string) fell back tomap[string]anyinstead ofany.
Loose-field fallbacks dropped from 36 to 25. No API-method signatures changed.
go get github.com/flashcatcloud/go-flashduty@v0.1.1v0.1.0 — first public release
The official Go client for the Flashduty Open API — a thin, typed wrapper in the style of google/go-github.
Highlights
- Full coverage — all 224 endpoints across 21 services, generated from the vendored OpenAPI spec (219 POST + 5 GET with query-parameter encoding).
- Thin & typed — every method maps to exactly one HTTP call and returns
(*T, *Response, error); no hidden cross-endpoint enrichment. - Service-grouped —
client.Incidents.List,client.Alerts..., etc. - Composable transport — retry/caching/tracing compose as
http.RoundTrippermiddleware viaWithTransport. - Pagination — embedded
ListOptions(go-github style) on list requests, withsearch_after_ctxcursor support. - Errors & rate limits —
*ErrorResponse/*RateLimitErrorwitherrors.As, typedErrorCodeOf/IsNotFound/IsRateLimitedpredicates. - Optional retry helper —
flashdutyretry: a safe-by-default retrying transport (429/5xx, honorsRetry-After, deterministic backoff, replays only replayable bodies). - Deterministic codegen —
go generate ./...regenerates the typed layer from the spec; CI guards against drift.
Install
go get github.com/flashcatcloud/go-flashduty@v0.1.0Requires Go 1.24+.
The API surface targets stabilization at
v1.0.0after validation against the live API.