m
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
70f77a53d9
commit
00d16dbfd1
1 changed files with 21 additions and 0 deletions
21
cmd/frostfs-adm/internal/commonflags/rpc.go
Normal file
21
cmd/frostfs-adm/internal/commonflags/rpc.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
package commonflags
|
||||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
// InitRPC inits common flags for storage node services.
|
||||
func InitRPC(ff *pflag.FlagSet) {
|
||||
ff.StringP(EndpointFlag, EndpointFlagShort, "", EndpointFlagDesc)
|
||||
ff.String(ProtoConfigPath, "", "Path to the consensus node configuration")
|
||||
ff.String(LocalDumpFlag, "", "Path to the blocks dump file")
|
||||
}
|
||||
|
||||
// BindRPC binds API flags of storage node services to the viper.
|
||||
func BindRPC(ff *pflag.FlagSet) {
|
||||
// LocalDumpFlag is left unbind intentionally:
|
||||
// it serves as an explicit signal to use local dump instead of a remote RPC.
|
||||
_ = viper.BindPFlag(EndpointFlag, ff.Lookup(EndpointFlag))
|
||||
_ = viper.BindPFlag(ProtoConfigPath, ff.Lookup(ProtoConfigPath))
|
||||
}
|
Loading…
Reference in a new issue