service

package
v0.0.0-...-6e101f3 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithForwardModifier

func WithForwardModifier(md GrpcForwardResponseModifier) forwardModifierConfigure

func WithIncomingHeaderMatcher

func WithIncomingHeaderMatcher(fn IncomingHeaderMatcher) incomingHeaderMatcher

func WithLogVerbose

func WithLogVerbose(v bool) *logVerboseConfigure

func WithLogger

func WithLogger(log logger.Logger) loggerConfigure

func WithMarshaler

func WithMarshaler(mime string, m runtime.Marshaler) marshalerOptionConfigure

func WithMaxRecvMsgSize

func WithMaxRecvMsgSize(size int) maxRecvMsgSize

WithMaxRecvMsgSize allows server to received this such size while allows client to be able to receive this such as well. NOTE: there is no limit during send operation in both server/client

func WithMetadataModifier

func WithMetadataModifier(md GrpcMetadataModifier) metadataModifierConfigure

func WithMiddlewareConfigure

func WithMiddlewareConfigure(unaryMiddlewares []grpc.UnaryServerInterceptor, streamMiddlewares []grpc.StreamServerInterceptor) middlewareConfigure

func WithOutgoingHeaderMatcher

func WithOutgoingHeaderMatcher(fn OutgoingHeaderMatcher) outgoingHeaderMatcher

func WithTransportCredential

func WithTransportCredential(server, client credentials.TransportCredentials) transportCredentialConfigure

Types

type CustomizeMarshaler

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

type GrpcForwardResponseModifier

type GrpcForwardResponseModifier func(context.Context, http.ResponseWriter, proto.Message) error

GrpcForwardResponseModifier would be used to modify http.ResponseWriter before the forward process is started

type GrpcMetadataModifier

type GrpcMetadataModifier func(context.Context, *http.Request) metadata.MD

GrpcMetadataModifier can be used to pass http.Requests into grpc context via metadata.MD

type IncomingHeaderMatcher

type IncomingHeaderMatcher runtime.HeaderMatcherFunc

IncomingHeaderMatcher is used to convert grpc.header to http.header with whitelisted

type OutgoingHeaderMatcher

type OutgoingHeaderMatcher runtime.HeaderMatcherFunc

OutgoingHeaderMatcher is used to convert http.header to grpc.metadata with whitelisted

type ServerService

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

func NewServerService

func NewServerService(
	grpcPort int,
	httpPort int,
	configures ...ServiceConfigure,
) (*ServerService, error)

func (*ServerService) AddGatewayRoutes

func (s *ServerService) AddGatewayRoutes(routes ...*httpgateway.Route) error

func (*ServerService) RegisterService

func (s *ServerService) RegisterService(sd *grpc.ServiceDesc, serviceImpl any, handlers ...httpgateway.GatewayHandlerFunc) error

func (*ServerService) Start

func (s *ServerService) Start() error

func (*ServerService) Stop

func (s *ServerService) Stop() error

type ServiceConfig

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

type ServiceConfigure

type ServiceConfigure interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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