feat: login

This commit is contained in:
Rogee
2024-09-02 14:50:51 +08:00
parent 97e0731e2e
commit d739ca0184
7 changed files with 80 additions and 51 deletions

View File

@@ -30,7 +30,7 @@ func InitClient(cfg *config.Config) error {
)
logger = zap.New(logCore)
client = NewClient(cfg)
client = NewClient(logger, cfg)
return nil
}
@@ -39,8 +39,12 @@ func Close() error {
return nil
}
func getClient() *TClient {
return client
}
func wrapE(f func(context.Context) error) func(cmd *cobra.Command, args []string) error {
return func(cmd *cobra.Command, args []string) error {
return client.Client.Run(context.Background(), f)
return getClient().Client.Run(context.Background(), f)
}
}