grpc_scope

package
v0.0.0-...-202847b Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package grpc_scope handles setting and retrieving the store/scope for clients and servers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunModeNewOutgoingContext

func RunModeNewOutgoingContext(ctx context.Context, runMode scope.TypeID) context.Context

RunModeNewOutgoingContext use on client side to transmit a store/scope to the server.

func StreamServerInterceptor

func StreamServerInterceptor(sf store.Finder) grpc.StreamServerInterceptor

StreamServerInterceptor returns a new stream server interceptor that performs per-request the store ID and website ID detection by the run mode. Store and website ID gets packed into the context with function scope.WithContext. Which can be later extracted via scope.FromContext. A client must add the run mode to the context via function RunModeNewOutgoingContext.

func UnaryServerInterceptor

func UnaryServerInterceptor(sf store.Finder) grpc.UnaryServerInterceptor

UnaryServerInterceptor returns a new unary server interceptors that performs per-request the store ID and website ID detection by the run mode. Store and website ID gets packed into the context with function scope.WithContext. Which can be later extracted via scope.FromContext. A client must add the run mode to the context via function RunModeNewOutgoingContext.

Types

This section is empty.

Jump to

Keyboard shortcuts

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