fxgrpc

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2024 License: Apache-2.0, MIT Imports: 10 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunHTTPGateway added in v0.0.3

func RunHTTPGateway(lc fx.Lifecycle, s fx.Shutdowner, logger *zap.Logger, config *Config, g *HTTPGatewayHandler) error

func RunHealthServer added in v0.0.3

func RunHealthServer(lc fx.Lifecycle, s fx.Shutdowner, config *Config, logger *zap.Logger, sn toolkitfx.ServiceName)

func RunLivenessGateway added in v0.0.3

func RunLivenessGateway(lc fx.Lifecycle, s fx.Shutdowner, logger *zap.Logger, config *Config, h *LivenessGatewayHandler) error

func RunRegisteredGRPCServer added in v0.0.3

func RunRegisteredGRPCServer(lc fx.Lifecycle, s fx.Shutdowner, logger *zap.Logger, gs *GRPCServer)

Types

type Config

type Config struct {
	GRPC            GRPCConfig
	Health          HealthConfig
	HTTPGateway     HTTPGatewayConfig
	LivenessGateway LivenessGatewayConfig
}

type GRPCConfig

type GRPCConfig struct {
	Host                                    string        `default:"0.0.0.0"`
	Port                                    string        `default:"8080"`
	MaxConnectionAge                        time.Duration `default:"5m"`
	KeepAliveEnforcementMinTime             time.Duration `default:"1m"`
	KeepAliveEnforcementPermitWithoutStream bool          `default:"true"`
}

type GRPCServer

type GRPCServer struct {
	Server *grpcutils.Server
}

type HTTPGatewayConfig added in v0.0.4

type HTTPGatewayConfig struct {
	Host string `default:"0.0.0.0"`
	Port string `default:"9090"`
}

type HTTPGatewayHandler added in v0.0.4

type HTTPGatewayHandler struct {
	Handler func(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
}

type HealthConfig

type HealthConfig struct {
	Enabled bool   `default:"true"`
	Host    string `default:"0.0.0.0"`
	Port    string `default:"10010"`
}

type LivenessGatewayConfig added in v0.0.4

type LivenessGatewayConfig struct {
	Host string `default:"0.0.0.0"`
	Port string `default:"8086"`
}

type LivenessGatewayHandler added in v0.0.4

type LivenessGatewayHandler struct {
	Handler http.Handler
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL