add comments

master
Paulo Simão 2021-11-29 10:45:25 -03:00
parent befca816d5
commit 571810c476
1 changed files with 4 additions and 0 deletions

View File

@ -16,11 +16,15 @@ type Cli struct {
*api.ApiCli *api.ApiCli
} }
//Log saves log to database after populated
func (c *Cli) Log(l *types.Log) error { func (c *Cli) Log(l *types.Log) error {
l.Alias = c.ReplayEnvAlias() l.Alias = c.ReplayEnvAlias()
l.Dtlogend = time.Now() l.Dtlogend = time.Now()
return c.HttpCli().JsonPost("/api/v1/log/add", l, nil) return c.HttpCli().JsonPost("/api/v1/log/add", l, nil)
} }
//NewLog creates a new log instance in the client, capable of collecting data in memory for later saving it to the
//database by calling Log
func (c *Cli) NewLog() *types.Log { func (c *Cli) NewLog() *types.Log {
ret := &types.Log{} ret := &types.Log{}
ret.Alias = c.ReplayEnvAlias() ret.Alias = c.ReplayEnvAlias()