Documentation ¶
Overview ¶
Package grpc is the root module of the k6-grpc extension.
Index ¶
- type Client
- func (c *Client) AsyncInvoke(method string, req sobek.Value, params sobek.Value) (*sobek.Promise, error)
- func (c *Client) Close() error
- func (c *Client) Connect(addr string, params sobek.Value) (bool, error)
- func (c *Client) Invoke(method string, req sobek.Value, params sobek.Value) (*grpcext.InvokeResponse, error)
- func (c *Client) Load(importPaths []string, filenames ...string) ([]MethodInfo, error)
- func (c *Client) LoadProtoset(protosetPath string) ([]MethodInfo, error)
- type MethodInfo
- type ModuleInstance
- type RootModule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a gRPC client that can be used to make RPC requests
func (*Client) AsyncInvoke ¶ added in v0.51.0
func (c *Client) AsyncInvoke( method string, req sobek.Value, params sobek.Value, ) (*sobek.Promise, error)
AsyncInvoke creates and calls a unary RPC by fully qualified method name asynchronously
func (*Client) Connect ¶
Connect is a block dial to the gRPC server at the given address (host:port)
func (*Client) Invoke ¶
func (c *Client) Invoke( method string, req sobek.Value, params sobek.Value, ) (*grpcext.InvokeResponse, error)
Invoke creates and calls a unary RPC by fully qualified method name
func (*Client) Load ¶
func (c *Client) Load(importPaths []string, filenames ...string) ([]MethodInfo, error)
Load will parse the given proto files and make the file descriptors available to request.
func (*Client) LoadProtoset ¶ added in v0.41.0
func (c *Client) LoadProtoset(protosetPath string) ([]MethodInfo, error)
LoadProtoset will parse the given protoset file (serialized FileDescriptorSet) 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 Sobek VM
type ModuleInstance ¶ added in v0.37.0
type ModuleInstance struct {
// contains filtered or unexported fields
}
ModuleInstance represents an instance of the GRPC module for every VU.
func (*ModuleInstance) Exports ¶ added in v0.37.0
func (mi *ModuleInstance) Exports() modules.Exports
Exports returns the exports of the grpc module.
func (*ModuleInstance) NewClient ¶ added in v0.37.0
func (mi *ModuleInstance) NewClient(_ sobek.ConstructorCall) *sobek.Object
NewClient is the JS constructor for the grpc Client.
type RootModule ¶ added in v0.37.0
type RootModule struct{}
RootModule is the global module instance that will create module instances for each VU.
func (*RootModule) NewModuleInstance ¶ added in v0.37.0
func (r *RootModule) NewModuleInstance(vu modules.VU) modules.Instance
NewModuleInstance implements the modules.Module interface to return a new instance for each VU.