Documentation
¶
Index ¶
- type Middleware
- type Opt
- func WithGRPCRoutes(router RouterFunc) Opt
- func WithHTTPRoutes(router RouterFunc) Opt
- func WithHostPolicy(policy autocert.HostPolicy) Opt
- func WithInsecurePort(insecurePort int) Opt
- func WithLogger(logger *logger.Logger) Opt
- func WithMiddlewares(middlewares ...Middleware) Opt
- func WithSecurePort(securePort int) Opt
- func WithStreamInterceptors(sinterceptors ...grpc.StreamServerInterceptor) Opt
- func WithUnaryInterceptors(uinterceptors ...grpc.UnaryServerInterceptor) Opt
- type Proxy
- type RouterFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Middleware ¶
Middleware is an http middleware
type Opt ¶
type Opt func(p *Proxy)
Opt is a function that configures a Proxy instance
func WithGRPCRoutes ¶
func WithGRPCRoutes(router RouterFunc) Opt
WithGRPCRoutes sets the gRPC RouterFunc which takes a hostname and returns an endpoint to route to. either http routes, gRPC routes, or both are required.
func WithHTTPRoutes ¶
func WithHTTPRoutes(router RouterFunc) Opt
WithHTTPRoutes sets the http RouterFunc which takes a hostname and returns an endpoint to route to either http routes, gRPC routes, or both are required.
func WithHostPolicy ¶
func WithHostPolicy(policy autocert.HostPolicy) Opt
WithHostPolicy sets the host policy function on the proxy(required)
func WithInsecurePort ¶
WithInsecurePort sets the port that non-encrypted traffic will be served on(optional)
func WithLogger ¶
WithLogger sets the proxies logger instance(optional)
func WithMiddlewares ¶
func WithMiddlewares(middlewares ...Middleware) Opt
WithMiddlewares sets the http middlewares on encrypted & non-encrypted traffic(optional)
func WithSecurePort ¶
WithSecurePort sets the port that encrypted traffic will be served on(optional)
func WithStreamInterceptors ¶
func WithStreamInterceptors(sinterceptors ...grpc.StreamServerInterceptor) Opt
WithStreamInterceptors adds gRPC stream interceptors to the proxy instance
func WithUnaryInterceptors ¶
func WithUnaryInterceptors(uinterceptors ...grpc.UnaryServerInterceptor) Opt
WithUnaryInterceptors adds gRPC unary interceptors to the proxy instance