proxy

package
v0.0.0-...-963ac0d Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: GPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ToNextResolver = errors.New("to next resolver")
)

Functions

func AsContextedAnyResolver

func AsContextedAnyResolver(ctx context.Context, in RuntimeProtoStore) jsonpb.AnyResolver

func GetUserDefinedTarget

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

Types

type Context

type Context struct {
	context.Context
	// contains filtered or unexported fields
}

Context is

type ProxyServer

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

ProxyServer is TODO: treat as a real gRPC server.

func New

func New(opts ...ServerOpt) *ProxyServer

New is

func (*ProxyServer) Invoke

func (ps *ProxyServer) Invoke(ctx *Context) (proto.Message, *metadataSet, error)

func (*ProxyServer) Meta

func (p *ProxyServer) Meta() map[string]string

func (*ProxyServer) Name

func (p *ProxyServer) Name() string

func (*ProxyServer) ServeHTTP

func (ps *ProxyServer) ServeHTTP(ctx *gin.Context)

func (*ProxyServer) Setup

func (p *ProxyServer) Setup(s *server.Server) error

type ResolveOnceRequest

type ResolveOnceRequest struct {
	ServiceFullyQualifiedName string
	UserDefinedTarget         string
}

type RuntimeProtoStore

type RuntimeProtoStore interface {
	GetMethodMessage(context.Context, string, string) (proto.Message, proto.Message, error)
	GetMessage(context.Context, string) (proto.Message, error)
}

type RuntimeServiceResolver

type RuntimeServiceResolver interface {
	ResolveOnce(context.Context, *ResolveOnceRequest) (string, error)
	Name() string
}

type ServerOpt

type ServerOpt func(*ProxyServer)

func SetProtoStore

func SetProtoStore(in RuntimeProtoStore) ServerOpt

func SetResolver

func SetResolver(in RuntimeServiceResolver) ServerOpt

Jump to

Keyboard shortcuts

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