transport

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllowAllOrigins = []string{"*"}

AllowAllOrigins is an explicit opt-in escape hatch for the old permissive CORS behavior (e.g. quick local dev) — pass it to setUpCors instead of retyping a wildcard. Never the generated default: AllowCredentials: true (required for cookie-based auth) is only valid alongside an explicit origin allowlist per the CORS spec, never "*".

Functions

func NewGatewayMux

func NewGatewayMux(cookieSecure bool) *runtime.ServeMux

NewGatewayMux builds the grpc-gateway mux shared by every *Impl.Gateway() method. CookieToMetadataAnnotator lets browser callers authenticate via the access_token cookie instead of an explicit Authorization header; CookieForwardResponseOption turns x-set-cookie-*/x-clear-auth-cookies gRPC response metadata into real Set-Cookie headers. Both are no-ops until a handler explicitly sets those keys, so this is safe to use uniformly regardless of whether this project ends up using cookie-based auth.

Types

type GrpcImpl

type GrpcImpl interface {
	Register(srv grpc.ServiceRegistrar)
}

type GrpcWithGateway

type GrpcWithGateway interface {
	Gateway(ctx context.Context, endpoint string, opts ...grpc.DialOption) (rootRoute string, handler http.Handler)
}

type ServersManager

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

func NewServerManager

func NewServerManager(ctx context.Context, listener net.Listener, allowedOrigins []string) (*ServersManager, error)

func (*ServersManager) AddHttpHandler

func (s *ServersManager) AddHttpHandler(path string, handler http.Handler)

func (*ServersManager) AddImplementation

func (s *ServersManager) AddImplementation(ctx context.Context, grpcImpls ...GrpcImpl)

func (*ServersManager) AddServerOption

func (s *ServersManager) AddServerOption(opts ...grpc.ServerOption)

func (*ServersManager) Start

func (m *ServersManager) Start() error

func (*ServersManager) Stop

func (m *ServersManager) Stop() error

Jump to

Keyboard shortcuts

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