mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-13 02:23:51 +00:00
kucoin: split cmd to files
This commit is contained in:
parent
6161a6a292
commit
76f122d998
23
examples/kucoin/accounts.go
Normal file
23
examples/kucoin/accounts.go
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
|
var accountsCmd = &cobra.Command{
|
||||||
|
Use: "accounts",
|
||||||
|
|
||||||
|
// SilenceUsage is an option to silence usage when an error occurs.
|
||||||
|
SilenceUsage: true,
|
||||||
|
|
||||||
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
|
accounts, err := client.AccountService.QueryAccounts()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
logrus.Infof("accounts: %+v", accounts)
|
||||||
|
return nil
|
||||||
|
},
|
||||||
|
}
|
|
@ -21,41 +21,6 @@ func init() {
|
||||||
rootCmd.AddCommand(subAccountsCmd)
|
rootCmd.AddCommand(subAccountsCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
var accountsCmd = &cobra.Command{
|
|
||||||
Use: "accounts",
|
|
||||||
|
|
||||||
// SilenceUsage is an option to silence usage when an error occurs.
|
|
||||||
SilenceUsage: true,
|
|
||||||
|
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
|
||||||
accounts, err := client.AccountService.QueryAccounts()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Infof("accounts: %+v", accounts)
|
|
||||||
return nil
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
var subAccountsCmd = &cobra.Command{
|
|
||||||
Use: "subaccounts",
|
|
||||||
Short: "subaccounts",
|
|
||||||
|
|
||||||
// SilenceUsage is an option to silence usage when an error occurs.
|
|
||||||
SilenceUsage: true,
|
|
||||||
|
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
|
||||||
subAccounts, err := client.AccountService.QuerySubAccounts()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Infof("subAccounts: %+v", subAccounts)
|
|
||||||
return nil
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
var rootCmd = &cobra.Command{
|
var rootCmd = &cobra.Command{
|
||||||
Use: "kucoin",
|
Use: "kucoin",
|
||||||
Short: "kucoin",
|
Short: "kucoin",
|
||||||
|
|
24
examples/kucoin/subaccounts.go
Normal file
24
examples/kucoin/subaccounts.go
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
|
var subAccountsCmd = &cobra.Command{
|
||||||
|
Use: "subaccounts",
|
||||||
|
Short: "subaccounts",
|
||||||
|
|
||||||
|
// SilenceUsage is an option to silence usage when an error occurs.
|
||||||
|
SilenceUsage: true,
|
||||||
|
|
||||||
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
|
subAccounts, err := client.AccountService.QuerySubAccounts()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
logrus.Infof("subAccounts: %+v", subAccounts)
|
||||||
|
return nil
|
||||||
|
},
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user