refactor all service dependency injection
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
)
|
||||
|
||||
type ExposeOptions struct {
|
||||
Dependencies
|
||||
GRPC *grpc.Server
|
||||
Gateway *gwRuntime.ServeMux
|
||||
Config *Config
|
||||
@@ -19,6 +20,7 @@ type ExposeOptions struct {
|
||||
type Config = config.SrvConfig
|
||||
|
||||
func Expose(options ExposeOptions) error {
|
||||
applyDependencies(options.Dependencies)
|
||||
if options.Config != nil {
|
||||
config.Spec = *options.Config
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user