grpc

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(options ...Option) tfx.Server

Types

type Config

type Config struct {
	Port                 int
	EnableHealthCheck    bool
	EnableValidate       bool
	EnableRecovery       bool
	MaxConcurrentStreams uint32
	Metrics              *struct {
		Port int
	}
}

type Option

type Option func(o *grpcOptions)

func Address

func Address(addr string) Option

func EnableHealthCheck

func EnableHealthCheck() Option

func EnableRecovery

func EnableRecovery() Option

func EnableValidate

func EnableValidate() Option

func FromConfig

func FromConfig(c *Config) Option

func MaxConcurrentStreams

func MaxConcurrentStreams(maxConcurrentStreams uint32) Option

func Metrics

func Metrics(port int) Option

type Server

type Server struct {
	// contains filtered or unexported fields
}

func (*Server) Provide

func (app *Server) Provide() fx.Option

func (*Server) RegisterService

func (app *Server) RegisterService(constructors ...any)

type Service

type Service interface {
	Register(srv *grpc.Server)
}

Jump to

Keyboard shortcuts

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