Skip to content

Commit

Permalink
json2 format
Browse files Browse the repository at this point in the history
  • Loading branch information
kdudkov committed Oct 21, 2023
1 parent 0812e6f commit dea30d5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
19 changes: 19 additions & 0 deletions cmd/takreplay/dumper.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,25 @@ func (g *JsonDumper) Process(msg *cot.CotMessage) error {
return nil
}

type Json2Dumper struct {
}

func (g *Json2Dumper) Start() {
}

func (g *Json2Dumper) Stop() {
}

func (g *Json2Dumper) Process(msg *cot.CotMessage) error {
b, err := json.Marshal(msg.TakMessage)
if err != nil {
return err
}
fmt.Println(string(b))
fmt.Println(msg.TakMessage.GetCotEvent().GetDetail().GetXmlDetail())
return nil
}

type GpxDumper struct {
name string
prevStale time.Time
Expand Down
2 changes: 2 additions & 0 deletions cmd/takreplay/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ func main() {
dmp = new(TextDumper)
case "json":
dmp = new(JsonDumper)
case "json2":
dmp = new(Json2Dumper)
case "gpx":
if *uid == "" {
fmt.Println("need uid to make gpx")
Expand Down

0 comments on commit dea30d5

Please sign in to comment.