Skip to content

Releases: flashcatcloud/go-flashduty

v0.3.0 — human-readable response timestamps

30 May 06:53

Choose a tag to compare

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) and TimestampMilli (milliseconds) types, both int64-based:
    • MarshalJSON → quoted RFC3339 in the local timezone.
    • UnmarshalJSON accepts either a numeric epoch or an RFC3339 string, so values round-trip cleanly.
    • Zero value stays the numeric 0 sentinel (never a 1970 date) and is dropped by omitempty.
    • String() for fmt/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 keeps int64. 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.Time

Full Changelog: v0.2.1...v0.3.0

v0.2.1 — docs cleanup

30 May 04:52

Choose a tag to compare

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

30 May 04:49

Choose a tag to compare

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 flashdutyretry subpackage is now retry. Update imports to github.com/flashcatcloud/go-flashduty/retry and construct with retry.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.Raw exposes 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

30 May 03:59

Choose a tag to compare

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 to map[string]any instead of the underlying type. Nullable IDs are now int64, nullable arrays are typed slices, etc.
  • Pure $ref schemas (e.g. FilterGroup = {$ref: OrFilterGroup}) were emitted as empty structs instead of type aliases.
  • oneOf/anyOf polymorphic values (e.g. default_value: bool|string|[]string) fell back to map[string]any instead of any.

Loose-field fallbacks dropped from 36 to 25. No API-method signatures changed.

go get github.com/flashcatcloud/go-flashduty@v0.1.1

v0.1.0 — first public release

30 May 03:52

Choose a tag to compare

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-groupedclient.Incidents.List, client.Alerts..., etc.
  • Composable transport — retry/caching/tracing compose as http.RoundTripper middleware via WithTransport.
  • Pagination — embedded ListOptions (go-github style) on list requests, with search_after_ctx cursor support.
  • Errors & rate limits*ErrorResponse / *RateLimitError with errors.As, typed ErrorCodeOf/IsNotFound/IsRateLimited predicates.
  • Optional retry helperflashdutyretry: a safe-by-default retrying transport (429/5xx, honors Retry-After, deterministic backoff, replays only replayable bodies).
  • Deterministic codegengo generate ./... regenerates the typed layer from the spec; CI guards against drift.

Install

go get github.com/flashcatcloud/go-flashduty@v0.1.0

Requires Go 1.24+.

The API surface targets stabilization at v1.0.0 after validation against the live API.