Update options to be public. This means people can implement the interfaces and actually use the options
This commit is contained in:
@@ -14,7 +14,7 @@ type Example struct{}
|
||||
|
||||
func (e *Example) Call(ctx context.Context, req *example.Request, rsp *example.Response) error {
|
||||
log.Info("Received Example.Call request")
|
||||
rsp.Msg = server.Config().Id() + ": Hello " + req.Name
|
||||
rsp.Msg = server.DefaultOptions().Id + ": Hello " + req.Name
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@@ -14,7 +14,7 @@ type Example struct{}
|
||||
func (e *Example) Call(ctx context.Context, req *example.Request, rsp *example.Response) error {
|
||||
md, _ := c.GetMetadata(ctx)
|
||||
log.Infof("Received Example.Call request with metadata: %v", md)
|
||||
rsp.Msg = server.Config().Id() + ": Hello " + req.Name
|
||||
rsp.Msg = server.DefaultOptions().Id + ": Hello " + req.Name
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@@ -31,7 +31,7 @@ func main() {
|
||||
// optionally setup command line usage
|
||||
cmd.Init()
|
||||
|
||||
md := server.Config().Metadata()
|
||||
md := server.DefaultOptions().Metadata
|
||||
md["datacenter"] = "local"
|
||||
|
||||
server.DefaultServer = server.NewServer(
|
||||
|
Reference in New Issue
Block a user