proxyutil

package module
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ProviderSet = wire.NewSet(
		NewServer,
		NewServerOption,
	)
)

Functions

func RemoveOutgoingHeader

func RemoveOutgoingHeader(whitelist map[string]string) runtime.ServeMuxOption

Types

type Address

type Address string

func (Address) Address

func (a Address) Address() string

type Server

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

func NewServer

func NewServer(opt *ServerOption) *Server

func (*Server) Handle

func (s *Server) Handle(fn func(proxy *runtime.ServeMux) http.HandlerFunc) *Server

func (*Server) Listen

func (s *Server) Listen(ctx context.Context)

func (*Server) Register

func (s *Server) Register(fn func(proxy *runtime.ServeMux, endpoint string, dialOpts []grpc.DialOption)) *Server

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

func (*Server) Stop

func (s *Server) Stop(ctx context.Context)

type ServerOption

type ServerOption struct {
	GrpcAddress  grpcutil.Address
	GrpcDialOpts []grpc.DialOption
	Listener     net.Listener
	Logger       *slog.Logger
	Server       *runtime.ServeMux
	// contains filtered or unexported fields
}

func NewServerOption

func NewServerOption(
	grpcAddress grpcutil.Address, grpcDialOpts []grpc.DialOption,
	addr Address, logger *slog.Logger, opts ...runtime.ServeMuxOption) (*ServerOption, func(), error)

Jump to

Keyboard shortcuts

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