Documentation ¶
Overview ¶
Package fgrpc is a generated protocol buffer package.
It is generated from these files:
ping.proto
It has these top-level messages:
PingMessage
Index ¶
- Constants
- func Dial(serverAddr string, tls bool) (conn *grpc.ClientConn, err error)
- func PingClientCall(serverAddr string, tls bool, n int, payload string) (float64, error)
- func PingServer(port string, healthServiceName string) int
- func RegisterPingServerServer(s *grpc.Server, srv PingServerServer)
- type GRPCRunnerOptions
- type GRPCRunnerResults
- type HealthResultMap
- type PingMessage
- type PingServerClient
- type PingServerServer
Constants ¶
const (
// DefaultGRPCPort is the Fortio gRPC server default port number.
DefaultGRPCPort = "8079"
)
const (
// DefaultHealthServiceName is the default health service name used by fortio.
DefaultHealthServiceName = "ping"
)
Variables ¶
This section is empty.
Functions ¶
func Dial ¶ added in v0.7.0
func Dial(serverAddr string, tls bool) (conn *grpc.ClientConn, err error)
Dial dials grpc either using insecure or using default tls setup. TODO: option to specify certs.
func PingClientCall ¶ added in v0.8.0
PingClientCall calls the ping service (presumably running as PingServer on the destination).
func PingServer ¶ added in v0.8.0
PingServer starts a grpc ping (and health) echo server. returns the port being bound (useful when passing "0" as the port to get a dynamic server). Pass the healthServiceName to use for the grpc service name health check (or pass DefaultHealthServiceName) to be marked as SERVING.
func RegisterPingServerServer ¶
func RegisterPingServerServer(s *grpc.Server, srv PingServerServer)
Types ¶
type GRPCRunnerOptions ¶
type GRPCRunnerOptions struct { periodic.RunnerOptions Destination string Service string Profiler string // file to save profiles to. defaults to no profiling Secure bool // use tls transport AllowInitialErrors bool // whether initial errors don't cause an abort }
GRPCRunnerOptions includes the base RunnerOptions plus http specific options.
type GRPCRunnerResults ¶
type GRPCRunnerResults struct { periodic.RunnerResults RetCodes HealthResultMap Destination string // contains filtered or unexported fields }
GRPCRunnerResults is the aggregated result of an GRPCRunner. Also is the internal type used per thread/goroutine.
func RunGRPCTest ¶
func RunGRPCTest(o *GRPCRunnerOptions) (*GRPCRunnerResults, error)
RunGRPCTest runs an http test and returns the aggregated stats.
func (*GRPCRunnerResults) Run ¶ added in v0.4.2
func (grpcstate *GRPCRunnerResults) Run(t int)
Run exercises GRPC health check at the target QPS. To be set as the Function in RunnerOptions.
type HealthResultMap ¶ added in v0.8.0
type HealthResultMap map[grpc_health_v1.HealthCheckResponse_ServingStatus]int64
HealthResultMap short cut for the map of results to count. -1 for errors.
func GrpcHealthCheck ¶ added in v0.8.0
GrpcHealthCheck makes a grpc client call to the standard grpc health check service.
type PingMessage ¶
type PingMessage struct { Seq int64 `protobuf:"varint,1,opt,name=seq" json:"seq,omitempty"` Ts int64 `protobuf:"varint,2,opt,name=ts" json:"ts,omitempty"` Payload string `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"` }
func (*PingMessage) Descriptor ¶
func (*PingMessage) Descriptor() ([]byte, []int)
func (*PingMessage) GetPayload ¶
func (m *PingMessage) GetPayload() string
func (*PingMessage) GetSeq ¶
func (m *PingMessage) GetSeq() int64
func (*PingMessage) GetTs ¶
func (m *PingMessage) GetTs() int64
func (*PingMessage) ProtoMessage ¶
func (*PingMessage) ProtoMessage()
func (*PingMessage) Reset ¶
func (m *PingMessage) Reset()
func (*PingMessage) String ¶
func (m *PingMessage) String() string
type PingServerClient ¶
type PingServerClient interface {
Ping(ctx context.Context, in *PingMessage, opts ...grpc.CallOption) (*PingMessage, error)
}
func NewPingServerClient ¶
func NewPingServerClient(cc *grpc.ClientConn) PingServerClient
type PingServerServer ¶
type PingServerServer interface {
Ping(context.Context, *PingMessage) (*PingMessage, error)
}