"github.com/spf13/cobra"
jww "github.com/spf13/jwalterweatherman"
+
+ "github.com/bytom/util"
)
var createTransactionFeedCmd = &cobra.Command{
in.Alias = args[0]
in.Filter = args[1]
- _, exitCode := clientCall("/create-transaction-feed", &in)
- if exitCode != Success {
+ _, exitCode := util.ClientCall("/create-transaction-feed", &in)
+ if exitCode != util.Success {
os.Exit(exitCode)
}
Short: "list all of transaction feeds",
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
- data, exitCode := clientCall("/list-transaction-feeds")
- if exitCode != Success {
+ data, exitCode := util.ClientCall("/list-transaction-feeds")
+ if exitCode != util.Success {
os.Exit(exitCode)
}
printJSONList(data)
var in txFeed
in.Alias = args[0]
- _, exitCode := clientCall("/delete-transaction-feed", &in)
- if exitCode != Success {
+ _, exitCode := util.ClientCall("/delete-transaction-feed", &in)
+ if exitCode != util.Success {
os.Exit(exitCode)
}
var in txFeed
in.Alias = args[0]
- data, exitCode := clientCall("/get-transaction-feed", &in)
- if exitCode != Success {
+ data, exitCode := util.ClientCall("/get-transaction-feed", &in)
+ if exitCode != util.Success {
os.Exit(exitCode)
}
printJSON(data)
in.Alias = args[0]
in.Filter = args[1]
- if _, exitCode := clientCall("/update-transaction-feed", &in); exitCode != Success {
+ if _, exitCode := util.ClientCall("/update-transaction-feed", &in); exitCode != util.Success {
os.Exit(exitCode)
}
jww.FEEDBACK.Println("Successfully updated transaction feed")