grpc_rest_server

package module
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: MIT Imports: 17 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host                   string
	Port                   string
	Mode                   string
	AllowedHeaders         []string
	AllowedOutgoingHeaders map[string]string

	ServiceDesc               *grpc.ServiceDesc
	RegisterRestHandlerServer func(ctx context.Context, mux *runtime.ServeMux, service any) error
	// By default 4 mb
	MaxRequestSize int
	// By default 4 mb
	MaxResponceSize int
	// Cert == nil, then insecure credentials will be used, only for grpc
	Cert *tls.Certificate
	// Used for REST
	TlsConfig *tls.Config
}

type Server added in v1.0.10

type Server struct {
	AllowedHeaders         []string
	AllowedOutgoingHeaders map[string]string
	// contains filtered or unexported fields
}

func NewServer

func NewServer(logger log.Logger, service any) Server

func (Server) GetDefaultOptions added in v1.0.10

func (s Server) GetDefaultOptions() *[]grpc.ServerOption

func (Server) Run added in v1.0.10

func (s Server) Run(ctx context.Context, cfg Config, metric interceptors.Metrics,
	grpcOptions *[]grpc.ServerOption, customRestMux *runtime.ServeMux) error

func (Server) Shutdown added in v1.0.10

func (s Server) Shutdown(ctx context.Context)

Jump to

Keyboard shortcuts

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