Documentation ¶
Index ¶
Constants ¶
View Source
const (
UrlFlagName = "url"
)
Variables ¶
View Source
var ExecCmd = &cobra.Command{
Use: "exec",
}
ExecCmd represents the exec command
View Source
var QueryCmd = &cobra.Command{
Use: "query",
}
QueryCmd represents the query command
View Source
var UnsuccessfulTxs = &cobra.Command{ Use: "unsuccessful-txs", Short: "Query unsuccessfully processed transactions", RunE: func(cmd *cobra.Command, args []string) error { url, err := cmd.Flags().GetString(UrlFlagName) if err != nil { return err } client, err := icqhttp.NewICQClient(url) if err != nil { return fmt.Errorf("failed to get new icq client: %w", err) } txs, err := client.GetUnsuccessfulTxs() if err != nil { return fmt.Errorf("failed to get unsuccessful txs: %w", err) } var response bytes.Buffer encoder := json.NewEncoder(&response) encoder.SetIndent("", " ") err = encoder.Encode(txs) if err != nil { return fmt.Errorf("failed to encode unsuccessful transactions: %w", err) } fmt.Printf("Unsuccessful txs:\n%s\n", response.String()) return nil }, }
UnsuccessfulTxs represents the unsuccessful-txs command
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.