hosting

package
v1.100.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: MIT Imports: 23 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authorizer

type Authorizer interface {
	GRPCInterceptor() grpc.UnaryServerInterceptor

	// TODO(alberto): Eliminar cuando services/v2 desimplemente el metodo
	CheckIDToken(audience, subject string, handler routing.Handler) routing.Handler
}

type GRPCServer

type GRPCServer struct {
	*grpc.Server
	// contains filtered or unexported fields
}

func GRPC

func GRPC(platform Platform, opts ...Option) *GRPCServer

func (*GRPCServer) Gateway

func (server *GRPCServer) Gateway(fn func(context.Context, *runtime.ServeMux, string, []grpc.DialOption) error)

func (*GRPCServer) HTTPGateway

func (server *GRPCServer) HTTPGateway(fn func(r *routing.Server))

func (*GRPCServer) Serve

func (server *GRPCServer) Serve()

type Option

type Option func(cnf *config)

Option of a server.

func WithAuth

func WithAuth(auth Authorizer) Option

func WithCORS

func WithCORS(domains ...string) Option

WithCORS configures valid CORS origins for grpc-gateway APIs. Only valid with the GRPC() constructor.

func WithGRPCOptions

func WithGRPCOptions(opts ...grpc.ServerOption) Option

WithGRPCOptions configures GRPC server options. Only valid with the GRPC() constructor.

func WithProfiler

func WithProfiler() Option

WithProfiler enables the Google Cloud Profiler for the application.

func WithRoutingOptions

func WithRoutingOptions(opts ...routing.ServerOption) Option

WithRoutingOptions configures web server options. Only valid with the Web() constructor.

type Platform

type Platform interface {
	Init() error
	Shutdown(ctx context.Context) error
}

type WebServer

type WebServer struct {
	*routing.Server
	// contains filtered or unexported fields
}

func Web

func Web(platform Platform, opts ...Option) *WebServer

func (*WebServer) Serve

func (server *WebServer) Serve()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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