rpc

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package rpc contains the gRPC endpoints and support code.

Index

Constants

This section is empty.

Variables

Set is used by wire.

Functions

func ProvideRPC

ProvideRPC attaches all of the service implementations to a *grpc.Server and returns it.

Types

type AuthInterceptor

type AuthInterceptor struct {
	Connector *oidc.Connector
	Enforcer  *enforcer.Enforcer
	Logger    *log.Logger
	Tokens    token.TokensServer
	// contains filtered or unexported fields
}

AuthInterceptor will examine an incoming RPC request for authorization data and decorate the context with a token.Session.

Unauthorized requests will be rejected unless the service implementation implements DefaultSession.

func ProvideAuthInterceptor

func ProvideAuthInterceptor(
	connector *oidc.Connector,
	logger *log.Logger,
	tokens token.TokensServer,
) (*AuthInterceptor, error)

ProvideAuthInterceptor is called by wire.

func (*AuthInterceptor) Stream

func (i *AuthInterceptor) Stream(
	srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler,
) error

Stream wraps a streaming gRPC call.

func (*AuthInterceptor) Unary

func (i *AuthInterceptor) Unary(
	ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler,
) (ret interface{}, err error)

Unary wraps a unary gRPC call.

type BusyInterceptor

type BusyInterceptor struct {
	common.BusyLatch
}

BusyInterceptor ensures that a vhost.VHost is present in RPC calls.

func (BusyInterceptor) Stream

func (i BusyInterceptor) Stream(
	srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler,
) error

Stream wraps a streaming gRPC call.

func (BusyInterceptor) Unary

func (i BusyInterceptor) Unary(
	ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler,
) (ret interface{}, err error)

Unary wraps a unary gRPC call.

type ElideInterceptor

type ElideInterceptor struct {
	Enforcer *enforcer.Enforcer
}

ElideInterceptor provides services for eliding marked message fields.

func (*ElideInterceptor) Stream

func (i *ElideInterceptor) Stream(
	srv interface{}, ss grpc.ServerStream, _ *grpc.StreamServerInfo, handler grpc.StreamHandler,
) error

Stream wraps a streaming gRPC call.

func (*ElideInterceptor) Unary

func (i *ElideInterceptor) Unary(
	ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler,
) (interface{}, error)

Unary wraps a unary gRPC call.

type VHostInterceptor

type VHostInterceptor struct {
	Logger *log.Logger
	Mapper *common.VHostMap
}

VHostInterceptor ensures that a vhost.VHost is present in RPC calls.

func (*VHostInterceptor) Stream

func (i *VHostInterceptor) Stream(
	srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler,
) error

Stream wraps a streaming gRPC call.

func (*VHostInterceptor) Unary

func (i *VHostInterceptor) Unary(
	ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler,
) (ret interface{}, err error)

Unary wraps a unary gRPC call.

Jump to

Keyboard shortcuts

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