]> Cypherpunks repositories - nncp.git/commitdiff
Use an updated recfile library develop
authorSergey Matveev <stargrave@stargrave.org>
Sun, 13 Jul 2025 07:28:21 +0000 (10:28 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 13 Jul 2025 07:28:21 +0000 (10:28 +0300)
src/cmd/nncp-log/main.go
src/go.mod
src/go.sum
src/humanizer.go
src/log.go

index dc4074cb9d94f7e626aab7324bb0973fedcad9eb..3ec6feaa483b2f9cab7eb1a346bf32e87a863beb 100644 (file)
@@ -24,7 +24,7 @@ import (
        "os"
 
        "go.cypherpunks.su/nncp/v8"
-       "go.cypherpunks.su/recfile/v2"
+       "go.cypherpunks.su/recfile/v3"
 )
 
 func usage() {
index 5a3a2e74084ec46b22d88bd53c2aa2146fe26aa2..97b0793e4501f83b2e2dea0e25a83b22453128c3 100644 (file)
@@ -12,7 +12,7 @@ require (
        github.com/klauspost/compress v1.17.9
        github.com/yggdrasil-network/yggdrasil-go v0.5.6
        go.cypherpunks.ru/balloon v1.1.1
-       go.cypherpunks.su/recfile/v2 v2.0.0
+       go.cypherpunks.su/recfile/v3 v3.0.0
        golang.org/x/crypto v0.25.0
        golang.org/x/net v0.27.0
        golang.org/x/sys v0.22.0
index 825884bd398c252b0ea1c38f3be2c12795f2382a..f0b0bc9ae1ee6ab972dbf9f6de94a53f2c81ed3e 100644 (file)
@@ -67,8 +67,8 @@ github.com/yggdrasil-network/yggdrasil-go v0.5.6/go.mod h1:WAqMZ4e1QSf/EKbzfD77X
 github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
 go.cypherpunks.ru/balloon v1.1.1 h1:ypHM1DRf/XuCrp9pDkTHg00CqZX/Np/APb//iHvDJTA=
 go.cypherpunks.ru/balloon v1.1.1/go.mod h1:k4s4ozrIrhpBjj78Z7LX8ZHxMQ+XE7DZUWl8gP2ojCo=
-go.cypherpunks.su/recfile/v2 v2.0.0 h1:Q2o+OzM1H2O1WnshU88r+waBqylkqZj8plBdBWZitcU=
-go.cypherpunks.su/recfile/v2 v2.0.0/go.mod h1:36EnyBwx6VpsSM5MMcYGTDiKrVEP49S09p33EFuhQYU=
+go.cypherpunks.su/recfile/v3 v3.0.0 h1:cHuH9GK153v+XJogb4XxuDMaC+RGmn4G2G5MLJ3SIpc=
+go.cypherpunks.su/recfile/v3 v3.0.0/go.mod h1:JAkipcy9IUNuYMR+vfNqf/f6KydLdhw1TBaOnNjdHv4=
 go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
 go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
index 62d021e73b4692695539c24aed0d45128dd7977d..1ca695e2a93d23d7484b21a468d498e2e256f981 100644 (file)
@@ -20,7 +20,7 @@ import (
        "strings"
        "time"
 
-       "go.cypherpunks.su/recfile/v2"
+       "go.cypherpunks.su/recfile/v3"
 )
 
 func (ctx *Ctx) HumanizeRec(rec string) string {
index 93303bb2cfa7f0de647c9cb87c2dd8ab591cb02c..8d99446f748dc9e9848f155f759c5dbb4eba7ea4 100644 (file)
@@ -22,7 +22,7 @@ import (
        "sync"
        "time"
 
-       "go.cypherpunks.su/recfile/v2"
+       "go.cypherpunks.su/recfile/v3"
        "golang.org/x/sys/unix"
 )
 
@@ -47,8 +47,8 @@ func (les LEs) Rec() string {
                panic(err)
        }
        _, err = w.WriteFields(recfile.Field{
-               Name:  "When",
-               Value: time.Now().UTC().Format(time.RFC3339Nano),
+               F:  "When",
+               V: time.Now().UTC().Format(time.RFC3339Nano),
        })
        if err != nil {
                panic(err)
@@ -57,22 +57,22 @@ func (les LEs) Rec() string {
                switch v := le.V.(type) {
                case int, int8, uint8, int64, uint64:
                        _, err = w.WriteFields(recfile.Field{
-                               Name:  le.K,
-                               Value: fmt.Sprintf("%d", v),
+                               F:  le.K,
+                               V: fmt.Sprintf("%d", v),
                        })
                case bool:
                        _, err = w.WriteFields(recfile.Field{
-                               Name:  le.K,
-                               Value: fmt.Sprintf("%v", v),
+                               F:  le.K,
+                               V: fmt.Sprintf("%v", v),
                        })
                case []string:
                        if len(v) > 0 {
-                               _, err = w.WriteFieldMultiline(le.K, v)
+                               _, err = w.WriteField(le.K, v)
                        }
                default:
                        _, err = w.WriteFields(recfile.Field{
-                               Name:  le.K,
-                               Value: fmt.Sprintf("%s", v),
+                               F:  le.K,
+                               V: fmt.Sprintf("%s", v),
                        })
                }
                if err != nil {