shared

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package shared contains shared data between the host and plugins.

Index

Constants

This section is empty.

Variables

View Source
var Handshake = plugin.HandshakeConfig{
	ProtocolVersion:  1,
	MagicCookieKey:   "GATEWAY_SERVER_PLUGIN",
	MagicCookieValue: "hello",
}

Handshake is a common handshake that is shared by plugin and host.

View Source
var PluginMap = map[string]plugin.Plugin{
	"tokenInfo": &TokenInfoPlugin{},
}

Functions

This section is empty.

Types

type GRPCClient

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

GRPCClient is an implementation of TokenInfo that talks over gRPC.

func (*GRPCClient) VerifyToken

func (m *GRPCClient) VerifyToken(ctx context.Context, request apis.VerifyRequest) (apis.VerifyResponse, error)

type GRPCServer

type GRPCServer struct {
	Impl apis.TokenInfo
	// contains filtered or unexported fields
}

Here is the gRPC server that GRPCClient talks to.

func (*GRPCServer) VerifyToken

func (m *GRPCServer) VerifyToken(
	ctx context.Context,
	req *proto.VerifyRequest) (*proto.VerifyResponse, error)

type RPCClient

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

func (*RPCClient) VerifyToken

func (m *RPCClient) VerifyToken(ctx context.Context, request apis.VerifyRequest) (apis.VerifyResponse, error)

type RPCServer

type RPCServer struct {
	Impl apis.TokenInfo
}

func (*RPCServer) VerifyToken

func (m *RPCServer) VerifyToken(args map[string]interface{}, resp *map[string]interface{}) error

type TokenInfoPlugin

type TokenInfoPlugin struct {
	Impl apis.TokenInfo
}

func (*TokenInfoPlugin) Client

func (*TokenInfoPlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (*TokenInfoPlugin) GRPCClient

func (p *TokenInfoPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)

func (*TokenInfoPlugin) GRPCServer

func (p *TokenInfoPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

func (*TokenInfoPlugin) Server

func (p *TokenInfoPlugin) Server(*plugin.MuxBroker) (interface{}, error)

Jump to

Keyboard shortcuts

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