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