grpc

package
v2.0.0-...-ca14b28 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Enable defines if the gRPC server should be enabled.
	Enable bool `mapstructure:"enable" toml:"enable" comment:"Enable defines if the gRPC server should be enabled."`

	// Address defines the API server to listen on
	Address string `mapstructure:"address" toml:"address" comment:"Address defines the gRPC server address to bind to."`

	// MaxRecvMsgSize defines the max message size in bytes the server can receive.
	// The default value is 10MB.
	MaxRecvMsgSize int `` /* 172-byte string literal not displayed */

	// MaxSendMsgSize defines the max message size in bytes the server can send.
	// The default value is math.MaxInt32.
	MaxSendMsgSize int `` /* 178-byte string literal not displayed */
}

GRPCConfig defines configuration for the gRPC server.

func DefaultConfig

func DefaultConfig() *Config

type GRPCServer

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

func New

func New(logger log.Logger, v *viper.Viper, interfaceRegistry appmanager.InterfaceRegistry, app GRPCService) (GRPCServer, error)

New returns a correctly configured and initialized gRPC server. Note, the caller is responsible for starting the server.

func (GRPCServer) Config

func (g GRPCServer) Config() any

func (GRPCServer) Name

func (g GRPCServer) Name() string

func (GRPCServer) Start

func (g GRPCServer) Start(ctx context.Context) error

func (GRPCServer) Stop

func (g GRPCServer) Stop(ctx context.Context) error

type GRPCService

type GRPCService interface {
	// RegisterGRPCServer registers gRPC services directly with the gRPC server.
	RegisterGRPCServer(gogogrpc.Server)
}

Directories

Path Synopsis
Package gogoreflection implements gRPC reflection for gogoproto consumers the normal reflection library does not work as it points to a different singleton registry.
Package gogoreflection implements gRPC reflection for gogoproto consumers the normal reflection library does not work as it points to a different singleton registry.

Jump to

Keyboard shortcuts

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