Documentation ¶
Index ¶
- type Client
- func (c *Client) Close() error
- func (c *Client) Connect(ctxPtr *context.Context, addr string, params map[string]interface{}) (bool, error)
- func (*Client) HandleConn(context.Context, grpcstats.ConnStats)
- func (c *Client) HandleRPC(ctx context.Context, stat grpcstats.RPCStats)
- func (c *Client) Invoke(ctxPtr *context.Context, method string, req goja.Value, ...) (*Response, error)
- func (c *Client) Load(ctxPtr *context.Context, importPaths []string, filenames ...string) ([]MethodInfo, error)
- func (c *Client) Reflect(addr string, params map[string]interface{}) ([]MethodInfo, error)
- func (*Client) TagConn(ctx context.Context, _ *grpcstats.ConnTagInfo) context.Context
- func (*Client) TagRPC(ctx context.Context, _ *grpcstats.RPCTagInfo) context.Context
- type GRPC
- type MethodInfo
- type Response
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) Connect ¶
func (c *Client) Connect(ctxPtr *context.Context, addr string, params map[string]interface{}) (bool, error)
Connect is a block dial to the gRPC server at the given address (host:port) nolint: funlen
func (*Client) HandleConn ¶
HandleConn implements the stats.Handler interface
func (*Client) Invoke ¶
func (c *Client) Invoke(ctxPtr *context.Context, method string, req goja.Value, params map[string]interface{}) (*Response, error)
Invoke creates and calls a unary RPC by fully qualified method name nolint: funlen,gocognit,gocyclo
func (*Client) Load ¶
func (c *Client) Load(ctxPtr *context.Context, importPaths []string, filenames ...string) ([]MethodInfo, error)
Load will parse the given proto files and make the file descriptors available to request.
func (*Client) Reflect ¶
func (c *Client) Reflect(addr string, params map[string]interface{}) ([]MethodInfo, error)
Reflect will use the grpc reflection api to make the file descriptors available to request.
type GRPC ¶
type GRPC struct { StatusOK codes.Code `js:"StatusOK"` StatusCanceled codes.Code `js:"StatusCanceled"` StatusUnknown codes.Code `js:"StatusUnknown"` StatusInvalidArgument codes.Code `js:"StatusInvalidArgument"` StatusDeadlineExceeded codes.Code `js:"StatusDeadlineExceeded"` StatusNotFound codes.Code `js:"StatusNotFound"` StatusAlreadyExists codes.Code `js:"StatusAlreadyExists"` StatusPermissionDenied codes.Code `js:"StatusPermissionDenied"` StatusResourceExhausted codes.Code `js:"StatusResourceExhausted"` StatusFailedPrecondition codes.Code `js:"StatusFailedPrecondition"` StatusAborted codes.Code `js:"StatusAborted"` StatusOutOfRange codes.Code `js:"StatusOutOfRange"` StatusUnimplemented codes.Code `js:"StatusUnimplemented"` StatusInternal codes.Code `js:"StatusInternal"` StatusDataLoss codes.Code `js:"StatusDataLoss"` StatusUnauthenticated codes.Code `js:"StatusUnauthenticated"` }
GRPC represents the gRPC protocol module for k6
type MethodInfo ¶
type MethodInfo struct { grpc.MethodInfo `json:"-" js:"-"` Package string Service string FullMethod string }
MethodInfo holds information on any parsed method descriptors that can be used by the goja VM