Skip to content

Commit a96cd57

Browse files
committed
fix: update links, use netip
1 parent 1238362 commit a96cd57

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

docs/types/primitive.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,31 @@ String is byte sequence primitive type represent by Go `string` or `[]byte`.
1919
| Format | Type | Description |
2020
|-----------|---------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
2121
| byte | `[]byte` | Base64-encoded string as defined in [RFC4648](https://www.rfc-editor.org/rfc/rfc4648.html) |
22-
| date-time | [`time.Time`](https://pkg.go.dev/time#Time) | Date and time notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), for example, `2022-02-22T11:22:33Z` |
23-
| date | [`time.Time`](https://pkg.go.dev/time#Time) | Date only notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), for example, `2022-02-22` |
24-
| time | [`time.Time`](https://pkg.go.dev/time#Time) | Time only notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), for example, `11:22:33` |
22+
| date-time | [`time.Time`][time.Time] | Date and time notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), for example, `2022-02-22T11:22:33Z` |
23+
| date | [`time.Time`][time.Time] | Date only notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), for example, `2022-02-22` |
24+
| time | [`time.Time`][time.Time] | Time only notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), for example, `11:22:33` |
2525
| duration | [`time.Duration`](https://pkg.go.dev/time#Duration) | Go duration format |
2626
| uuid | [`uuid.UUID`](https://pkg.go.dev/github.com/google/uuid#UUID) | UUID |
27-
| ip | [`net.IP`](https://pkg.go.dev/net#IP) | Any IP (IPv4, IPv6) |
28-
| ipv4 | [`net.IP`](https://pkg.go.dev/net#IP) | IPv4, for example, `1.1.1.1` |
29-
| ipv6 | [`net.IP`](https://pkg.go.dev/net#IP) | IPv6, for example, `2001:db8:85a3::8a2e:370:7334` |
27+
| ip | [`netip.Addr`][netip.Addr] | Any IP (IPv4, IPv6) |
28+
| ipv4 | [`netip.Addr`][netip.Addr] | IPv4, for example, `1.1.1.1` |
29+
| ipv6 | [`netip.Addr`][netip.Addr] | IPv6, for example, `2001:db8:85a3::8a2e:370:7334` |
3030
| uri | [`url.URL`](https://pkg.go.dev/net/url#URL) | URL as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986) |
3131
| email | `string` | Email, for example, `[email protected]` |
3232
| binary | `string` | Binary string |
3333
| hostname | `string` | Hostname as defined by [RFC 1034, section 3.1](https://datatracker.ietf.org/doc/html/rfc1034#section-3.1) |
3434

3535
#### Non-standard formats
3636

37-
| Format | Type | Description |
38-
|-------------------|------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|
39-
| unix/unix-seconds | [`time.Time`](https://pkg.go.dev/time#Time) | [`Time.Unix()`](https://pkg.go.dev/time#Time.Unix), encoded as string. See [issue #307](https://github.com/ogen-go/ogen/issues/306) |
40-
| unix-nano | [`time.Time`](https://pkg.go.dev/time#Time) | [`Time.UnixNano()`](https://pkg.go.dev/time#Time.UnixNano), encoded as string. See [issue #307](https://github.com/ogen-go/ogen/issues/306) |
41-
| unix-micro | [`time.Time`](https://pkg.go.dev/time#Time) | [`Time.UnixMicro()`](https://pkg.go.dev/time#Time.UnixMicro), encoded as string. See [issue #307](https://github.com/ogen-go/ogen/issues/306) |
42-
| unix-milli | [`time.Time`](https://pkg.go.dev/time#Time) | [`Time.UnixMilli()`](https://pkg.go.dev/time#Time.UnixMilli), encoded as string. See [issue #307](https://github.com/ogen-go/ogen/issues/306) |
43-
| int32 | `int32` | 32-bit signed integer, encoded as string. See [issue #307](https://github.com/ogen-go/ogen/issues/307) |
44-
| int64 | `int64` | 64-bit signed integer, encoded as string. See [issue #307](https://github.com/ogen-go/ogen/issues/307) |
37+
| Format | Type | Description |
38+
|-------------------|--------------------------|---------------------------------------------------------------------------------|
39+
| unix/unix-seconds | [`time.Time`][time.Time] | [`Time.Unix()`](https://pkg.go.dev/time#Time.Unix), encoded as string |
40+
| unix-nano | [`time.Time`][time.Time] | [`Time.UnixNano()`](https://pkg.go.dev/time#Time.UnixNano), encoded as string |
41+
| unix-micro | [`time.Time`][time.Time] | [`Time.UnixMicro()`](https://pkg.go.dev/time#Time.UnixMicro), encoded as string |
42+
| unix-milli | [`time.Time`][time.Time] | [`Time.UnixMilli()`](https://pkg.go.dev/time#Time.UnixMilli), encoded as string |
43+
| int32 | `int32` | 32-bit signed integer |
44+
| int64 | `int64` | 64-bit signed integer |
45+
46+
See [issue #307](https://github.com/ogen-go/ogen/issues/307) for more information about these formats.
4547

4648
### Validation
4749

@@ -72,3 +74,7 @@ floating-point numbers.
7274
| integer || `int` | Integer numbers |
7375
| integer | int32 | `int32` | Signed 32-bit integers |
7476
| integer | int64 | `int64` | Signed 64-bit integers |
77+
78+
79+
[time.Time]: https://pkg.go.dev/time#Time
80+
[netip.Addr]: https://pkg.go.dev/net/netip#Addr

0 commit comments

Comments
 (0)