File tree 3 files changed +11
-1
lines changed
3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,10 @@ var clientCmd = &cobra.Command{
13
13
func init () {
14
14
rootCmd .AddCommand (clientCmd )
15
15
natsFlags (clientCmd )
16
+ clientFlags (clientCmd )
16
17
}
17
18
18
19
func bindClientCmdFlags (cmd * cobra.Command , args []string ) {
19
20
bindNatsFlags (cmd )
21
+ bindClientFlags (cmd )
20
22
}
Original file line number Diff line number Diff line change @@ -31,6 +31,14 @@ func natsFlags(cmd *cobra.Command) {
31
31
cmd .PersistentFlags ().Bool ("use-traffic-shaping" , false , "Local development connection" )
32
32
}
33
33
34
+ func bindClientFlags (cmd * cobra.Command ) {
35
+ viper .BindPFlag ("inbox_prefix" , cmd .Flags ().Lookup ("inbox-prefix" ))
36
+ }
37
+
38
+ func clientFlags (cmd * cobra.Command ) {
39
+ cmd .PersistentFlags ().String ("inbox-prefix" , "PIGGYBANK.ADMIN" , "subject prefix for replies" )
40
+ }
41
+
34
42
// bindServiceFlags binds the secret flag values to viper
35
43
func bindServiceFlags (cmd * cobra.Command ) {
36
44
viper .BindPFlag ("port" , cmd .Flags ().Lookup ("port" ))
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import (
10
10
)
11
11
12
12
func newNatsConnection (name string ) (* nats.Conn , error ) {
13
- opts := []nats.Option {nats .Name (name )}
13
+ opts := []nats.Option {nats .Name (name ), nats . CustomInboxPrefix ( viper . GetString ( "inbox_prefix" )) }
14
14
15
15
_ , ok := os .LookupEnv ("USER" )
16
16
You can’t perform that action at this time.
0 commit comments