1
1
mirror of https://github.com/wader/fq.git synced 2025-01-08 23:59:50 +03:00

tzif: moved document to tzif.md

This commit is contained in:
@0xb17bea125 2022-12-03 16:06:46 +09:00
parent 4481a77a1c
commit c4e7fc7919
4 changed files with 900 additions and 857 deletions

View File

@ -748,6 +748,16 @@ fq '.tcp_connections[] | select(.server.port=="rtmp") | d' file.cap
## tzif
### Get last transition time
```sh
fq '.v2plusdatablock.transition_times[-1] | tovalue' tziffile
```
### Count leap second records
```sh
fq '.v2plusdatablock.leap_second_records | length' tziffile
```
### Authors
- Takashi Oguma
[@bitbears-dev](https://github.com/bitbears-dev)
@ -756,7 +766,6 @@ fq '.tcp_connections[] | select(.server.port=="rtmp") | d' file.cap
### References
- https://datatracker.ietf.org/doc/html/rfc8536
## wasm
### Count opcode usage

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 140 KiB

After

Width:  |  Height:  |  Size: 141 KiB

View File

@ -1,6 +1,7 @@
package tzif
import (
"embed"
"fmt"
"time"
@ -10,6 +11,9 @@ import (
"github.com/wader/fq/pkg/scalar"
)
//go:embed tzif.md
var tzifFS embed.FS
func init() {
interp.RegisterFormat(decode.Format{
Name: format.TZIF,
@ -17,6 +21,7 @@ func init() {
DecodeFn: decodeTZIF,
Groups: []string{format.PROBE},
})
interp.RegisterFS(tzifFS)
}
func decodeTZIF(d *decode.D, _ any) any {

17
format/tzif/tzif.md Normal file
View File

@ -0,0 +1,17 @@
### Get last transition time
```sh
fq '.v2plusdatablock.transition_times[-1] | tovalue' tziffile
```
### Count leap second records
```sh
fq '.v2plusdatablock.leap_second_records | length' tziffile
```
### Authors
- Takashi Oguma
[@bitbears-dev](https://github.com/bitbears-dev)
[@0xb17bea125](https://twitter.com/0xb17bea125)
### References
- https://datatracker.ietf.org/doc/html/rfc8536