From 8fb8bb502ec20a726a2e8b829bbb3970a85709e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paulo=20Sima=CC=83o?= Date: Mon, 11 Oct 2021 14:53:32 -0300 Subject: [PATCH] added log table --- api/replay/cli.go | 6 ++++++ types/lib.go | 14 +++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/api/replay/cli.go b/api/replay/cli.go index d3c8ba4..4f80c36 100644 --- a/api/replay/cli.go +++ b/api/replay/cli.go @@ -3,6 +3,7 @@ package replay import ( "fmt" "os" + "time" "go.digitalcircle.com.br/open/replaycli-go/api" "go.digitalcircle.com.br/open/replaycli-go/types" @@ -13,6 +14,11 @@ type Cli struct { *api.ApiCli } +func (c *Cli) Log(l *types.Log) error { + l.Alias = c.ReplayEnvAlias() + l.Dtlog = time.Now() + return c.HttpCli().JsonPost("/api/v1/log", l, nil) +} func (c *Cli) ReplayEnvQueueId() string { return os.Getenv("REPLAY_QUEUEID") } diff --git a/types/lib.go b/types/lib.go index 0e1d98a..1376fb2 100644 --- a/types/lib.go +++ b/types/lib.go @@ -201,7 +201,19 @@ type Credentials struct { type Log struct { Model - Log []byte + Alias string + Title string + Tags string + Dtlog time.Time + Data []byte +} +type LogQuery struct { + From time.Time `json:"from"` + Until time.Time `json:"until"` + Limit int `json:"limit"` + Title string `json:"title"` + Alias string `json:"alias"` + Tags string `json:"tags"` } type Job struct {