wire

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package wire holds the renderings every JSON surface must agree on.

It exists because there is more than one such surface. The DTO layer in internal/api renders almost everything, and the SSE feed does not: an accounts.StateChange is marshalled by the accounts package and written straight to the socket. Section 4.4's rule -- RFC 3339, UTC, exactly millisecond precision -- was therefore stated twice, and the stream was the copy that drifted: Go's default time.Time marshalling is RFC3339Nano, which STRIPS trailing zeros, so `.507Z` and `.52Z` both appeared in one stream seconds apart. A client parsing a fixed three-digit fraction works until a timestamp lands on a multiple of ten milliseconds, which is one frame in ten. Intermittent is the worst way to fail.

So the rendering lives in one place that both layers call, and the next rule about how an instant looks on the wire is written once.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Instant

func Instant(t time.Time) string

Instant renders one moment. The zero time renders as the empty string; callers that distinguish "no such moment" from "the Unix epoch" use InstantPtr.

func InstantMS

func InstantMS(ms int64) *string

InstantMS renders an epoch-millisecond column, or nil for zero.

func InstantPtr

func InstantPtr(t time.Time) *string

InstantPtr renders a moment, or nil for the zero value -- "no such moment" and "the Unix epoch" are different facts and a caller must be able to tell them apart.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL