grpcgateway

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

+kubebuilder:validation:Optional

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module() fx.Option

Module is an fx module that sets up grpc-http Gateway.

Types

type Constructor

type Constructor struct {
	// Name of http server instance -- empty for main server. Gateway name will be the same as HTTP server name
	Name string
	// Config key
	ConfigKey string
	// Default gateway config
	DefaultConfig GRPCGatewayConfig
}

Constructor holds fields to configure grpc-http gateway.

func (Constructor) Annotate

func (constructor Constructor) Annotate() fx.Option

Annotate returns fx options that set up grpc-http gateway.

type GRPCGateway

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

GRPCGateway holds fields required for grpc-http gateway.

type GRPCGatewayConfig

type GRPCGatewayConfig struct {
	// gRPC server address to connect to - By default it points to HTTP server port because FluxNinja stack runs gRPC and HTTP servers on the same port
	GRPCAddr string `json:"grpc_server_address" validate:"omitempty,hostname_port"`
}

GRPCGatewayConfig holds configuration for gRPC to HTTP gateway swagger:model

type RegisterHandler

type RegisterHandler struct {
	// Handler func to invoke on start
	Handler RegisterHandlerFunc
	// gateway instance to register with -- empty = default gateway
	Name string
}

RegisterHandler holds fields to register grpc-http gateway handlers.

func (RegisterHandler) Annotate

func (rh RegisterHandler) Annotate() fx.Option

Annotate annotates handler function in rh and returns it. These handlers can be registered with grpc-http gateway.

type RegisterHandlerFunc

type RegisterHandlerFunc func(context.Context, *runtime.ServeMux, string, []grpc.DialOption) error

RegisterHandlerFunc is a handler function that registers grpc-http gateway handlers.

Jump to

Keyboard shortcuts

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