storeid

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Overview

Package storeid contains middleware to inject and manage the store ID context.

Index

Constants

View Source
const (

	// StoreIDHeader represents the HTTP header name used to
	// specify the OpenFGA store identifier in API requests.
	StoreIDHeader string = "Openfga-Store-Id"
)

Variables

This section is empty.

Functions

func NewStreamingInterceptor

func NewStreamingInterceptor() grpc.StreamServerInterceptor

NewStreamingInterceptor creates a grpc.StreamServerInterceptor which injects store_id metadata into the RPC context if an RPC message is received with a GetStoreId method.

func NewUnaryInterceptor

func NewUnaryInterceptor() grpc.UnaryServerInterceptor

NewUnaryInterceptor creates a grpc.UnaryServerInterceptor which injects store_id metadata into the RPC context if an RPC message is received with a GetStoreId method.

func SetStoreIDInContext

func SetStoreIDInContext(ctx context.Context, req interface{})

SetStoreIDInContext sets the store ID in the provided context based on information from the request.

func StoreIDFromContext

func StoreIDFromContext(ctx context.Context) (string, bool)

StoreIDFromContext retrieves the store ID stored in the provided context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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