@@ -7,43 +7,25 @@ package main
77import (
88 "context"
99 "fmt"
10- "net/url"
1110 "os"
1211 "os/signal"
1312 "syscall"
1413
15- "github.com/go-orb/go-orb/config"
1614 "github.com/go-orb/go-orb/log"
1715 "github.com/go-orb/go-orb/registry"
1816 "github.com/go-orb/go-orb/server"
1917 "github.com/go-orb/go-orb/types"
2018
2119 "github.com/go-orb/examples/benchmarks/rps/handler/echo"
2220 proto "github.com/go-orb/examples/benchmarks/rps/proto/echo"
21+ "github.com/go-orb/plugins/config/source/cli/urfave"
2322 "github.com/go-orb/plugins/server/drpc"
2423 mgrpc "github.com/go-orb/plugins/server/grpc"
2524 mhttp "github.com/go-orb/plugins/server/http"
2625
2726 "github.com/go-orb/wire"
2827)
2928
30- // provideConfigData reads the config from cli and returns it.
31- func provideConfigData (
32- serviceName types.ServiceName ,
33- serviceVersion types.ServiceVersion ,
34- ) (types.ConfigData , error ) {
35- u , err := url .Parse ("cli://urfave" )
36- if err != nil {
37- return nil , err
38- }
39-
40- cfgSections := types .SplitServiceName (serviceName )
41-
42- data , err := config .Read ([]* url.URL {u }, cfgSections )
43-
44- return data , err
45- }
46-
4729// provideServerOpts provides options for the go-orb server.
4830func provideServerOpts () ([]server.ConfigOption , error ) {
4931
@@ -144,7 +126,7 @@ func run(
144126 cb wireRunCallback ,
145127) (wireRunResult , error ) {
146128 panic (wire .Build (
147- provideConfigData ,
129+ urfave . ProvideConfigData ,
148130 wire .Value ([]log.Option {}),
149131 log .Provide ,
150132 wire .Value ([]registry.Option {}),
0 commit comments