Documentation
¶
Overview ¶
Example ¶
package main import ( "github.com/goph/fxt" fxgrpc "github.com/goph/fxt/grpc" "go.uber.org/fx" ) func main() { app := fx.New( fx.NopLogger, fxt.Bootstrap, fx.Provide( func() *fxgrpc.Config { return fxgrpc.NewConfig(":8080") }, fxgrpc.NewServer, ), ) if err := app.Err(); err != nil { panic(err) } }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Network string Addr string // Register the reflection API or not ReflectionEnabled bool }
Config holds a list of options used during the grpc server construction.
type ServerParams ¶
type ServerParams struct { dig.In Config *Config StreamInterceptor grpc.StreamServerInterceptor `optional:"true"` UnaryInterceptor grpc.UnaryServerInterceptor `optional:"true"` Logger log.Logger `optional:"true"` HealthCollector healthz.Collector `optional:"true"` Lifecycle fxt.Lifecycle }
ServerParams provides a set of dependencies for a grpc server constructor.
Click to show internal directories.
Click to hide internal directories.