grpc

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package grpc implements a protocol.Protocol driver for gRPC.

VegaLoad has no compiled proto stubs for whatever service a scenario targets — asking an author to generate and vendor them just to load test a service would fight the "every test is a file" principle in AGENTS.md. Instead this driver sends target.Body as an already-encoded message verbatim and hands back the response the same way, using a pass-through codec instead of protobuf's. The scripting layer (built later in Phase 0) is what will give a scenario author a convenient way to produce those bytes; this driver only needs to move them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

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

Driver is a gRPC protocol.Protocol. It dials once in New and reuses the same *grpc.ClientConn (and the HTTP/2 connection underneath it) across every call to Do.

func New

func New(target protocol.Target, timeout time.Duration) (*Driver, error)

New returns a ready-to-use Driver for target. target.URL is a bare "host:port", or "grpc://host:port" for the same thing written explicitly, or "grpcs://host:port" to dial over TLS. target.Method must be set to the full RPC method (e.g. "/package.Service/Method") — unlike the HTTP drivers there is no sensible default. timeout bounds each individual call.

New returns an error for anything that is a configuration problem (a missing Method, an unparseable target, an unsupported scheme) — never for the target being unreachable, which Do reports per call instead, since dialing is lazy.

func (*Driver) Close

func (d *Driver) Close() error

Close implements protocol.Protocol.

func (*Driver) Do

func (d *Driver) Do(ctx context.Context) (protocol.Result, error)

Do implements protocol.Protocol.

func (*Driver) Name

func (d *Driver) Name() string

Name implements protocol.Protocol.

Jump to

Keyboard shortcuts

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