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 ¶
func Dial ¶ added in v0.16.0
func Dial(config AppClientConfig, options ...grpc.DialOption) (*grpc.ClientConn, error)
Dial creates a client connection.
Types ¶
type AppClientConfig ¶ added in v0.7.0
type AppClientConfig struct { // Addr is the gRPC connection address. Addr string `env:"" required:"true"` // Host can be used when the connection address and the certificate hostname differs. Host string `env:""` // Insecure makes the client use insecure channel. Insecure bool `env:""` }
AppClientConfig can be used in an application config to represent gRPC client connection details. It supports github.com/goph/nest
type Config ¶
type Config struct { Network string Addr string // Register the reflection API or not ReflectionEnabled bool // A list of arbitrary server options for the gRPC server Options []grpc.ServerOption }
Config holds a list of options used during the grpc server construction.
Directories ¶
Path | Synopsis |
---|---|
middleware
|
|
correlationid/internal/mocks
Code generated by mockery v1.0.0 Code generated by mockery v1.0.0
|
Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 |
Click to show internal directories.
Click to hide internal directories.