add comments
parent
befca816d5
commit
571810c476
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue