grpc

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection added in v0.2.0

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

Connection represents a gRPC client that can be used to make RPC requests

func (*Connection) Close added in v0.2.0

func (c *Connection) Close() error

Close will close the client gRPC connection

func (*Connection) Connect added in v0.2.0

func (c *Connection) Connect(addr string, params map[string]interface{}) (bool, error)

Connect is a block dial to the gRPC server at the given address (host:port)

func (*Connection) Invoke added in v0.2.0

func (c *Connection) Invoke(
	method string,
	req goja.Value,
	params map[string]interface{},
) (*grpcext.Response, error)

Invoke creates and calls a unary RPC by fully qualified method name

func (*Connection) Load added in v0.2.0

func (c *Connection) Load(importPaths []string, filenames ...string) ([]MethodInfo, error)

Load will parse the given proto files and make the file descriptors available to request.

type MethodInfo

type MethodInfo struct {
	Package         string
	Service         string
	FullMethod      string
	grpc.MethodInfo `json:"-" js:"-"`
}

MethodInfo holds information on any parsed method descriptors that can be used by the goja VM

type ModuleInstance

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

ModuleInstance represents an instance of the GRPC module for every VU.

func (*ModuleInstance) Exports

func (mi *ModuleInstance) Exports() modules.Exports

Exports returns the exports of the grpc module.

func (*ModuleInstance) NewClient

func (mi *ModuleInstance) NewClient(call goja.ConstructorCall) *goja.Object

NewClient is the JS constructor for the grpc Connection.

type RootModule

type RootModule struct{}

RootModule is the global module instance that will create module instances for each VU.

func New

func New() *RootModule

New returns a pointer to a new RootModule instance.

func (*RootModule) NewModuleInstance

func (*RootModule) NewModuleInstance(vu modules.VU) modules.Instance

NewModuleInstance implements the modules.Module interface to return a new instance for each VU.

Jump to

Keyboard shortcuts

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