request

package
v1.0.0-alpha.39 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNamespaceNotFound = api.Errorf(api.Code_NOT_FOUND, "namespace not found")

Functions

func GetNamespace

func GetNamespace(ctx context.Context) (string, error)

func IsAdminApi

func IsAdminApi(fullMethodName string) bool

func SetAccessToken

func SetAccessToken(ctx context.Context, token *AccessToken) context.Context

func SetNamespace

func SetNamespace(ctx context.Context, namespace string) context.Context

Types

type AccessToken

type AccessToken struct {
	Namespace string
	Sub       string
}

func GetAccessToken

func GetAccessToken(ctx context.Context) (*AccessToken, error)

type AccessTokenNamespaceExtractor

type AccessTokenNamespaceExtractor struct {
}

func (*AccessTokenNamespaceExtractor) Extract

func (tokenNamespaceExtractor *AccessTokenNamespaceExtractor) Extract(ctx context.Context) (string, error)

type NamespaceExtractor

type NamespaceExtractor interface {
	Extract(ctx context.Context) (string, error)
}

NamespaceExtractor - extract the namespace from context

type RequestMetadata

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

func GetRequestMetadata

func GetRequestMetadata(ctx context.Context) (*RequestMetadata, error)

type RequestMetadataCtxKey

type RequestMetadataCtxKey struct {
}

Jump to

Keyboard shortcuts

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