1
1
mirror of https://github.com/wader/fq.git synced 2024-11-23 18:56:52 +03:00

Lint and add basic doc

This commit is contained in:
Xentripetal 2022-02-09 20:46:12 -06:00
parent 4508241b1f
commit 2605bce4e3
3 changed files with 21 additions and 2 deletions

View File

@ -20,7 +20,7 @@
|`avc_pps` |H.264/AVC&nbsp;Picture&nbsp;Parameter&nbsp;Set |<sub></sub>|
|`avc_sei` |H.264/AVC&nbsp;Supplemental&nbsp;Enhancement&nbsp;Information |<sub></sub>|
|`avc_sps` |H.264/AVC&nbsp;Sequence&nbsp;Parameter&nbsp;Set |<sub></sub>|
|`avro_ocf` |Avro&nbsp;object&nbsp;container&nbsp;file |<sub></sub>|
|[`avro_ocf`](#avro_ocf) |Avro&nbsp;object&nbsp;container&nbsp;file |<sub></sub>|
|`bencode` |BitTorrent&nbsp;bencoding |<sub></sub>|
|`bsd_loopback_frame` |BSD&nbsp;loopback&nbsp;frame |<sub>`ipv4_packet`</sub>|
|[`bson`](#bson) |Binary&nbsp;JSON |<sub></sub>|
@ -130,6 +130,16 @@ If the schema is known and not that complicated it can be reproduced:
```
fq -d asn1_ber 'torepr as $r | ["version", "modulus", "private_exponent", "private_exponen", "prime1", "prime2", "exponent1", "exponent2", "coefficient"] | with_entries({key: .value, value: $r[.key]})' pkcs1.der
```
### avro_ocf
# Avro OCF
Supports reading Avro Object Container Format (OCF) files based on the [1.11.0 specification](https://avro.apache.org/docs/current/spec.html#Object+Container+Files).
Capable of handling null, deflate, and snappy codecs for data compression.
Limitations:
- Schema does not support self-referential types, only built-in types.
- Decimal logical types are not supported for decoding, will just be treated as their primitive type
### becode
Supports `torepr`:

8
format/avro/avro_ocf.md Normal file
View File

@ -0,0 +1,8 @@
# Avro OCF
Supports reading Avro Object Container Format (OCF) files based on the [1.11.0 specification](https://avro.apache.org/docs/current/spec.html#Object+Container+Files).
Capable of handling null, deflate, and snappy codecs for data compression.
Limitations:
- Schema does not support self-referential types, only built-in types.
- Decimal logical types are not supported for decoding, will just be treated as their primitive type

View File

@ -3,6 +3,8 @@ package avro
import (
"bytes"
"compress/flate"
"hash/crc32"
"github.com/golang/snappy"
"github.com/wader/fq/format"
"github.com/wader/fq/format/avro/decoders"
@ -11,7 +13,6 @@ import (
"github.com/wader/fq/pkg/bitio"
"github.com/wader/fq/pkg/decode"
"github.com/wader/fq/pkg/scalar"
"hash/crc32"
)
func init() {