connectrpc_transport

package module
v0.0.0-...-4fe7ace Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(opts ...Option) service.IService

NewServer creates a new gRPC server that implements service.IService interface.

Types

type Config

type Config struct {
	Enabled bool   `default:"true" usage:"allows to enable server" example:"true"`
	Addr    string `default:":9000" validate:"required,hostname_port" usage:"server listen address" example:"localhost:9000"`
}

Config provides configuration for grpc server.

type ConnectRPCService

type ConnectRPCService interface {
	Name() string
	RegisterHandler(otps ...connect.HandlerOption) (string, http.Handler)
}

IService custom interface for gRPC service.

type Option

type Option func(s *connectRPCServer)

Option allows customizing gRPC server.

func WithConfig

func WithConfig(v Config) Option

WithConfig allows set custom gRPC settings.

func WithConnectRPCOptions

func WithConnectRPCOptions(opts ...connect.HandlerOption) Option

WithConnectRPCOptions allows adding new connect rpc options.

func WithHttpServer

func WithHttpServer(v *http.Server) Option

WithHttpServer allows set custom http.Server.

func WithLogger

func WithLogger(v logger.Logger) Option

WithLogger allows set custom gRPC Logger.

func WithName

func WithName(v string) Option

WithName allows set custom gRPC Name.

func WithReflection

func WithReflection(services ...string) Option

WithServer allows to use reflection for grpc server.

func WithServeMux

func WithServeMux(v *http.ServeMux) Option

WithServer allows set custom gRPC Server.

func WithServerHandlerWrapper

func WithServerHandlerWrapper(v func(h http.Handler) http.Handler) Option

WithServerHandlerWrapper allows set custom server handler wrapper.

func WithServices

func WithServices(services ...ConnectRPCService) Option

WithServices allows adding new gRPC Service.

Jump to

Keyboard shortcuts

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