feat: add unix socket api(set debug)
This commit is contained in:
@ -6,6 +6,7 @@ import (
|
||||
"net/rpc"
|
||||
"net/url"
|
||||
"ultone/internal/log"
|
||||
"ultone/internal/opt"
|
||||
"ultone/internal/unix"
|
||||
)
|
||||
|
||||
@ -38,7 +39,7 @@ var (
|
||||
)
|
||||
|
||||
func initCli() {
|
||||
cliCommand.PersistentFlags().StringVar(&svc, "svc", "unix:///tmp/.cli.sock", "server unix listen address")
|
||||
cliCommand.PersistentFlags().StringVar(&svc, "svc", opt.RpcAddress, "server unix listen address")
|
||||
cliCommand.AddCommand(&cobra.Command{
|
||||
Use: "set",
|
||||
RunE: func(cmd *cobra.Command, args []string) (err error) {
|
||||
@ -65,6 +66,8 @@ func initCli() {
|
||||
}
|
||||
|
||||
log.Info(cmd.Context(), out.Msg)
|
||||
default:
|
||||
return fmt.Errorf("unknown set variable(debug is available now)")
|
||||
}
|
||||
|
||||
return nil
|
||||
|
@ -10,7 +10,6 @@ import (
|
||||
"ultone/internal/model"
|
||||
"ultone/internal/opt"
|
||||
"ultone/internal/tool"
|
||||
"ultone/internal/unix"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -33,7 +32,7 @@ func execute(ctx context.Context) error {
|
||||
tool.Must(api.Start(ctx))
|
||||
|
||||
// todo: if need some cli operation, should start local unix rpc svc
|
||||
tool.Must(unix.Start(ctx))
|
||||
//tool.Must(unix.Start(ctx))
|
||||
|
||||
<-ctx.Done()
|
||||
|
||||
|
Reference in New Issue
Block a user