grpc

package
v0.1.55 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package grpc implements the functions, types, and interfaces for the module.

Index

Constants

View Source
const (
	Scheme = "gateway"
)

Variables

This section is empty.

Functions

func NewServer

func NewServer(cfg *configv1.Service, ss ...OptionSetting) (*transhttp.Server, error)

NewServer Create a GRPC server instance

Types

type Option

type Option struct {
	Prefix        string
	HostIP        string
	ServiceName   string
	Discovery     registry.Discovery
	NodeFilters   []selector.NodeFilter
	Middlewares   []middleware.Middleware
	EndpointFunc  func(scheme string, host string, addr string) (string, error)
	ServerOptions []transhttp.ServerOption
}

type OptionSetting

type OptionSetting = func(o *Option)

func WithDiscovery

func WithDiscovery(serviceName string, discovery registry.Discovery) OptionSetting

func WithEndpointFunc

func WithEndpointFunc(endpointFunc func(scheme string, host string, addr string) (string, error)) OptionSetting

func WithHostIp

func WithHostIp(hostIp string) OptionSetting

func WithMiddlewares

func WithMiddlewares(middlewares ...middleware.Middleware) OptionSetting

func WithNodeFilter

func WithNodeFilter(filters ...selector.NodeFilter) OptionSetting

func WithPrefix

func WithPrefix(prefix string) OptionSetting

func WithServerOptions

func WithServerOptions(opts ...transhttp.ServerOption) OptionSetting

Jump to

Keyboard shortcuts

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