added getmyjson to replaycli
parent
f3abaa694d
commit
392c7940af
|
@ -1,6 +1,7 @@
|
|||
package replay
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"time"
|
||||
|
@ -110,6 +111,14 @@ func (c *Cli) QueueGetData(id string) (ret []byte, err error) {
|
|||
func (c *Cli) QueueGetMyData() ([]byte, error) {
|
||||
return c.QueueGetData(os.Getenv("REPLAY_QUEUEID"))
|
||||
}
|
||||
func (c *Cli) QueueGetMyJson(i interface{}) error {
|
||||
bs, err := c.QueueGetData(os.Getenv("REPLAY_QUEUEID"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = json.Unmarshal(bs, i)
|
||||
return err
|
||||
}
|
||||
func (c *Cli) QueueAbort() error {
|
||||
return c.HttpCli().JsonGet("/api/v1/queue/abort", nil)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue