samplev1

package
v0.0.0-...-1aa08c1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: BSD-3-Clause Imports: 28 Imported by: 0

Documentation

Overview

Package samplev1 provides sample Protocol Buffer definitions for dummy services.

Index

Constants

View Source
const (
	BarAPI_Ping_FullMethodName    = "/sample.v1.BarAPI/Ping"
	BarAPI_Health_FullMethodName  = "/sample.v1.BarAPI/Health"
	BarAPI_Request_FullMethodName = "/sample.v1.BarAPI/Request"
)
View Source
const (
	EchoAPI_Ping_FullMethodName   = "/sample.v1.EchoAPI/Ping"
	EchoAPI_Health_FullMethodName = "/sample.v1.EchoAPI/Health"
	EchoAPI_Echo_FullMethodName   = "/sample.v1.EchoAPI/Echo"
	EchoAPI_Faulty_FullMethodName = "/sample.v1.EchoAPI/Faulty"
	EchoAPI_Slow_FullMethodName   = "/sample.v1.EchoAPI/Slow"
)
View Source
const (
	FooAPI_Ping_FullMethodName             = "/sample.v1.FooAPI/Ping"
	FooAPI_Health_FullMethodName           = "/sample.v1.FooAPI/Health"
	FooAPI_Request_FullMethodName          = "/sample.v1.FooAPI/Request"
	FooAPI_Faulty_FullMethodName           = "/sample.v1.FooAPI/Faulty"
	FooAPI_Slow_FullMethodName             = "/sample.v1.FooAPI/Slow"
	FooAPI_OpenServerStream_FullMethodName = "/sample.v1.FooAPI/OpenServerStream"
	FooAPI_OpenClientStream_FullMethodName = "/sample.v1.FooAPI/OpenClientStream"
)

Variables

View Source
var BarAPI_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "sample.v1.BarAPI",
	HandlerType: (*BarAPIServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Ping",
			Handler:    _BarAPI_Ping_Handler,
		},
		{
			MethodName: "Health",
			Handler:    _BarAPI_Health_Handler,
		},
		{
			MethodName: "Request",
			Handler:    _BarAPI_Request_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "sample/v1/bar_api.proto",
}

BarAPI_ServiceDesc is the grpc.ServiceDesc for BarAPI service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var EchoAPI_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "sample.v1.EchoAPI",
	HandlerType: (*EchoAPIServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Ping",
			Handler:    _EchoAPI_Ping_Handler,
		},
		{
			MethodName: "Health",
			Handler:    _EchoAPI_Health_Handler,
		},
		{
			MethodName: "Echo",
			Handler:    _EchoAPI_Echo_Handler,
		},
		{
			MethodName: "Faulty",
			Handler:    _EchoAPI_Faulty_Handler,
		},
		{
			MethodName: "Slow",
			Handler:    _EchoAPI_Slow_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "sample/v1/echo_api.proto",
}

EchoAPI_ServiceDesc is the grpc.ServiceDesc for EchoAPI service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_sample_v1_bar_api_proto protoreflect.FileDescriptor
View Source
var File_sample_v1_echo_api_proto protoreflect.FileDescriptor
View Source
var File_sample_v1_foo_api_proto protoreflect.FileDescriptor
View Source
var File_sample_v1_model_proto protoreflect.FileDescriptor
View Source
var FooAPI_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "sample.v1.FooAPI",
	HandlerType: (*FooAPIServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Ping",
			Handler:    _FooAPI_Ping_Handler,
		},
		{
			MethodName: "Health",
			Handler:    _FooAPI_Health_Handler,
		},
		{
			MethodName: "Request",
			Handler:    _FooAPI_Request_Handler,
		},
		{
			MethodName: "Faulty",
			Handler:    _FooAPI_Faulty_Handler,
		},
		{
			MethodName: "Slow",
			Handler:    _FooAPI_Slow_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "OpenServerStream",
			Handler:       _FooAPI_OpenServerStream_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "OpenClientStream",
			Handler:       _FooAPI_OpenClientStream_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "sample/v1/foo_api.proto",
}

FooAPI_ServiceDesc is the grpc.ServiceDesc for FooAPI service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func DRPCRegisterBarAPI

func DRPCRegisterBarAPI(mux drpc.Mux, impl DRPCBarAPIServer) error

func DRPCRegisterEchoAPI

func DRPCRegisterEchoAPI(mux drpc.Mux, impl DRPCEchoAPIServer) error

func DRPCRegisterFooAPI

func DRPCRegisterFooAPI(mux drpc.Mux, impl DRPCFooAPIServer) error

func RegisterBarAPIHandler

func RegisterBarAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterBarAPIHandler registers the http handlers for service BarAPI to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterBarAPIHandlerClient

func RegisterBarAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BarAPIClient) error

RegisterBarAPIHandlerClient registers the http handlers for service BarAPI to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "BarAPIClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "BarAPIClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "BarAPIClient" to call the correct interceptors.

func RegisterBarAPIHandlerFromEndpoint

func RegisterBarAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterBarAPIHandlerFromEndpoint is same as RegisterBarAPIHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterBarAPIHandlerServer

func RegisterBarAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BarAPIServer) error

RegisterBarAPIHandlerServer registers the http handlers for service BarAPI to "mux". UnaryRPC :call BarAPIServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterBarAPIHandlerFromEndpoint instead.

func RegisterBarAPIServer

func RegisterBarAPIServer(s grpc.ServiceRegistrar, srv BarAPIServer)

func RegisterEchoAPIHandler

func RegisterEchoAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterEchoAPIHandler registers the http handlers for service EchoAPI to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterEchoAPIHandlerClient

func RegisterEchoAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EchoAPIClient) error

RegisterEchoAPIHandlerClient registers the http handlers for service EchoAPI to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "EchoAPIClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "EchoAPIClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "EchoAPIClient" to call the correct interceptors.

func RegisterEchoAPIHandlerFromEndpoint

func RegisterEchoAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterEchoAPIHandlerFromEndpoint is same as RegisterEchoAPIHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterEchoAPIHandlerServer

func RegisterEchoAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EchoAPIServer) error

RegisterEchoAPIHandlerServer registers the http handlers for service EchoAPI to "mux". UnaryRPC :call EchoAPIServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterEchoAPIHandlerFromEndpoint instead.

func RegisterEchoAPIServer

func RegisterEchoAPIServer(s grpc.ServiceRegistrar, srv EchoAPIServer)

func RegisterFooAPIHandler

func RegisterFooAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterFooAPIHandler registers the http handlers for service FooAPI to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterFooAPIHandlerClient

func RegisterFooAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client FooAPIClient) error

RegisterFooAPIHandlerClient registers the http handlers for service FooAPI to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "FooAPIClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "FooAPIClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "FooAPIClient" to call the correct interceptors.

func RegisterFooAPIHandlerFromEndpoint

func RegisterFooAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterFooAPIHandlerFromEndpoint is same as RegisterFooAPIHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterFooAPIHandlerServer

func RegisterFooAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server FooAPIServer) error

RegisterFooAPIHandlerServer registers the http handlers for service FooAPI to "mux". UnaryRPC :call FooAPIServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterFooAPIHandlerFromEndpoint instead.

func RegisterFooAPIServer

func RegisterFooAPIServer(s grpc.ServiceRegistrar, srv FooAPIServer)

Types

type BarAPIClient

type BarAPIClient interface {
	// Reachability test.
	Ping(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Pong, error)
	// Health test.
	Health(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*HealthResponse, error)
	// Sample request.
	Request(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Response, error)
}

BarAPIClient is the client API for BarAPI service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewBarAPIClient

func NewBarAPIClient(cc grpc.ClientConnInterface) BarAPIClient

type BarAPIServer

type BarAPIServer interface {
	// Reachability test.
	Ping(context.Context, *emptypb.Empty) (*Pong, error)
	// Health test.
	Health(context.Context, *emptypb.Empty) (*HealthResponse, error)
	// Sample request.
	Request(context.Context, *emptypb.Empty) (*Response, error)
	// contains filtered or unexported methods
}

BarAPIServer is the server API for BarAPI service. All implementations must embed UnimplementedBarAPIServer for forward compatibility

type DRPCBarAPIClient

type DRPCBarAPIClient interface {
	DRPCConn() drpc.Conn

	Ping(ctx context.Context, in *emptypb.Empty) (*Pong, error)
	Health(ctx context.Context, in *emptypb.Empty) (*HealthResponse, error)
	Request(ctx context.Context, in *emptypb.Empty) (*Response, error)
}

func NewDRPCBarAPIClient

func NewDRPCBarAPIClient(cc drpc.Conn) DRPCBarAPIClient

type DRPCBarAPIDescription

type DRPCBarAPIDescription struct{}

func (DRPCBarAPIDescription) Method

func (DRPCBarAPIDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool)

func (DRPCBarAPIDescription) NumMethods

func (DRPCBarAPIDescription) NumMethods() int

type DRPCBarAPIServer

type DRPCBarAPIServer interface {
	Ping(context.Context, *emptypb.Empty) (*Pong, error)
	Health(context.Context, *emptypb.Empty) (*HealthResponse, error)
	Request(context.Context, *emptypb.Empty) (*Response, error)
}

type DRPCBarAPIUnimplementedServer

type DRPCBarAPIUnimplementedServer struct{}

func (*DRPCBarAPIUnimplementedServer) Health

func (*DRPCBarAPIUnimplementedServer) Ping

func (*DRPCBarAPIUnimplementedServer) Request

type DRPCBarAPI_HealthStream

type DRPCBarAPI_HealthStream interface {
	drpc.Stream
	SendAndClose(*HealthResponse) error
}

type DRPCBarAPI_PingStream

type DRPCBarAPI_PingStream interface {
	drpc.Stream
	SendAndClose(*Pong) error
}

type DRPCBarAPI_RequestStream

type DRPCBarAPI_RequestStream interface {
	drpc.Stream
	SendAndClose(*Response) error
}

type DRPCEchoAPIClient

type DRPCEchoAPIClient interface {
	DRPCConn() drpc.Conn

	Ping(ctx context.Context, in *emptypb.Empty) (*Pong, error)
	Health(ctx context.Context, in *emptypb.Empty) (*HealthResponse, error)
	Echo(ctx context.Context, in *EchoRequest) (*EchoResponse, error)
	Faulty(ctx context.Context, in *emptypb.Empty) (*DummyResponse, error)
	Slow(ctx context.Context, in *emptypb.Empty) (*DummyResponse, error)
}

func NewDRPCEchoAPIClient

func NewDRPCEchoAPIClient(cc drpc.Conn) DRPCEchoAPIClient

type DRPCEchoAPIDescription

type DRPCEchoAPIDescription struct{}

func (DRPCEchoAPIDescription) Method

func (DRPCEchoAPIDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool)

func (DRPCEchoAPIDescription) NumMethods

func (DRPCEchoAPIDescription) NumMethods() int

type DRPCEchoAPIUnimplementedServer

type DRPCEchoAPIUnimplementedServer struct{}

func (*DRPCEchoAPIUnimplementedServer) Echo

func (*DRPCEchoAPIUnimplementedServer) Faulty

func (*DRPCEchoAPIUnimplementedServer) Health

func (*DRPCEchoAPIUnimplementedServer) Ping

func (*DRPCEchoAPIUnimplementedServer) Slow

type DRPCEchoAPI_EchoStream

type DRPCEchoAPI_EchoStream interface {
	drpc.Stream
	SendAndClose(*EchoResponse) error
}

type DRPCEchoAPI_FaultyStream

type DRPCEchoAPI_FaultyStream interface {
	drpc.Stream
	SendAndClose(*DummyResponse) error
}

type DRPCEchoAPI_HealthStream

type DRPCEchoAPI_HealthStream interface {
	drpc.Stream
	SendAndClose(*HealthResponse) error
}

type DRPCEchoAPI_PingStream

type DRPCEchoAPI_PingStream interface {
	drpc.Stream
	SendAndClose(*Pong) error
}

type DRPCEchoAPI_SlowStream

type DRPCEchoAPI_SlowStream interface {
	drpc.Stream
	SendAndClose(*DummyResponse) error
}

type DRPCFooAPIClient

type DRPCFooAPIClient interface {
	DRPCConn() drpc.Conn

	Ping(ctx context.Context, in *emptypb.Empty) (*Pong, error)
	Health(ctx context.Context, in *emptypb.Empty) (*HealthResponse, error)
	Request(ctx context.Context, in *emptypb.Empty) (*Response, error)
	Faulty(ctx context.Context, in *emptypb.Empty) (*DummyResponse, error)
	Slow(ctx context.Context, in *emptypb.Empty) (*DummyResponse, error)
	OpenServerStream(ctx context.Context, in *emptypb.Empty) (DRPCFooAPI_OpenServerStreamClient, error)
	OpenClientStream(ctx context.Context) (DRPCFooAPI_OpenClientStreamClient, error)
}

func NewDRPCFooAPIClient

func NewDRPCFooAPIClient(cc drpc.Conn) DRPCFooAPIClient

type DRPCFooAPIDescription

type DRPCFooAPIDescription struct{}

func (DRPCFooAPIDescription) Method

func (DRPCFooAPIDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool)

func (DRPCFooAPIDescription) NumMethods

func (DRPCFooAPIDescription) NumMethods() int

type DRPCFooAPIUnimplementedServer

type DRPCFooAPIUnimplementedServer struct{}

func (*DRPCFooAPIUnimplementedServer) Faulty

func (*DRPCFooAPIUnimplementedServer) Health

func (*DRPCFooAPIUnimplementedServer) OpenClientStream

func (*DRPCFooAPIUnimplementedServer) OpenServerStream

func (*DRPCFooAPIUnimplementedServer) Ping

func (*DRPCFooAPIUnimplementedServer) Request

func (*DRPCFooAPIUnimplementedServer) Slow

type DRPCFooAPI_FaultyStream

type DRPCFooAPI_FaultyStream interface {
	drpc.Stream
	SendAndClose(*DummyResponse) error
}

type DRPCFooAPI_HealthStream

type DRPCFooAPI_HealthStream interface {
	drpc.Stream
	SendAndClose(*HealthResponse) error
}

type DRPCFooAPI_OpenClientStreamClient

type DRPCFooAPI_OpenClientStreamClient interface {
	drpc.Stream
	Send(*OpenClientStreamRequest) error
	CloseAndRecv() (*StreamResult, error)
}

type DRPCFooAPI_OpenClientStreamStream

type DRPCFooAPI_OpenClientStreamStream interface {
	drpc.Stream
	SendAndClose(*StreamResult) error
	Recv() (*OpenClientStreamRequest, error)
}

type DRPCFooAPI_OpenServerStreamClient

type DRPCFooAPI_OpenServerStreamClient interface {
	drpc.Stream
	Recv() (*GenericStreamChunk, error)
}

type DRPCFooAPI_OpenServerStreamStream

type DRPCFooAPI_OpenServerStreamStream interface {
	drpc.Stream
	Send(*GenericStreamChunk) error
}

type DRPCFooAPI_PingStream

type DRPCFooAPI_PingStream interface {
	drpc.Stream
	SendAndClose(*Pong) error
}

type DRPCFooAPI_RequestStream

type DRPCFooAPI_RequestStream interface {
	drpc.Stream
	SendAndClose(*Response) error
}

type DRPCFooAPI_SlowStream

type DRPCFooAPI_SlowStream interface {
	drpc.Stream
	SendAndClose(*DummyResponse) error
}

type DummyResponse

type DummyResponse struct {

	// Generic status check, set to 'false' in case of errors.
	Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
	// contains filtered or unexported fields
}

Sample response structure.

func (*DummyResponse) Descriptor deprecated

func (*DummyResponse) Descriptor() ([]byte, []int)

Deprecated: Use DummyResponse.ProtoReflect.Descriptor instead.

func (*DummyResponse) GetOk

func (x *DummyResponse) GetOk() bool

func (*DummyResponse) ProtoMessage

func (*DummyResponse) ProtoMessage()

func (*DummyResponse) ProtoReflect

func (x *DummyResponse) ProtoReflect() protoreflect.Message

func (*DummyResponse) Reset

func (x *DummyResponse) Reset()

func (*DummyResponse) String

func (x *DummyResponse) String() string

type EchoAPIClient

type EchoAPIClient interface {
	// Reachability test.
	Ping(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Pong, error)
	// Health test.
	Health(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*HealthResponse, error)
	// Process an incoming echo request.
	Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error)
	// Returns an error roughly about 20% of the time.
	Faulty(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*DummyResponse, error)
	// Exhibit a random latency between 10 and 200ms.
	Slow(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*DummyResponse, error)
}

EchoAPIClient is the client API for EchoAPI service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewEchoAPIClient

func NewEchoAPIClient(cc grpc.ClientConnInterface) EchoAPIClient

type EchoAPIServer

type EchoAPIServer interface {
	// Reachability test.
	Ping(context.Context, *emptypb.Empty) (*Pong, error)
	// Health test.
	Health(context.Context, *emptypb.Empty) (*HealthResponse, error)
	// Process an incoming echo request.
	Echo(context.Context, *EchoRequest) (*EchoResponse, error)
	// Returns an error roughly about 20% of the time.
	Faulty(context.Context, *emptypb.Empty) (*DummyResponse, error)
	// Exhibit a random latency between 10 and 200ms.
	Slow(context.Context, *emptypb.Empty) (*DummyResponse, error)
	// contains filtered or unexported methods
}

EchoAPIServer is the server API for EchoAPI service. All implementations must embed UnimplementedEchoAPIServer for forward compatibility

type EchoHandler

type EchoHandler struct {
	UnimplementedEchoAPIServer
}

EchoHandler defines a sample implementation of the echo service provider.

func (*EchoHandler) Echo

func (eh *EchoHandler) Echo(_ context.Context, req *EchoRequest) (*EchoResponse, error)

Echo will process the incoming echo operation.

func (*EchoHandler) Faulty

func (eh *EchoHandler) Faulty(_ context.Context, _ *empty.Empty) (*DummyResponse, error)

Faulty will return an error about 20% of the time.

func (*EchoHandler) Health

func (eh *EchoHandler) Health(_ context.Context, _ *empty.Empty) (*HealthResponse, error)

Health provides a sample health check method.

func (*EchoHandler) Ping

func (eh *EchoHandler) Ping(_ context.Context, _ *empty.Empty) (*Pong, error)

Ping provides a sample reachability test method.

func (*EchoHandler) Slow

Slow will report a random latency between 10 to 200ms.

type EchoRequest

type EchoRequest struct {

	// Payload submitted to the "echo" request.
	Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

Sample request for the "echo" service.

func (*EchoRequest) Descriptor deprecated

func (*EchoRequest) Descriptor() ([]byte, []int)

Deprecated: Use EchoRequest.ProtoReflect.Descriptor instead.

func (*EchoRequest) GetValue

func (x *EchoRequest) GetValue() string

func (*EchoRequest) ProtoMessage

func (*EchoRequest) ProtoMessage()

func (*EchoRequest) ProtoReflect

func (x *EchoRequest) ProtoReflect() protoreflect.Message

func (*EchoRequest) Reset

func (x *EchoRequest) Reset()

func (*EchoRequest) String

func (x *EchoRequest) String() string

type EchoResponse

type EchoResponse struct {

	// Result generated by the server.
	Result string `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

The response generated by the "echo" server.

func (*EchoResponse) Descriptor deprecated

func (*EchoResponse) Descriptor() ([]byte, []int)

Deprecated: Use EchoResponse.ProtoReflect.Descriptor instead.

func (*EchoResponse) GetResult

func (x *EchoResponse) GetResult() string

func (*EchoResponse) ProtoMessage

func (*EchoResponse) ProtoMessage()

func (*EchoResponse) ProtoReflect

func (x *EchoResponse) ProtoReflect() protoreflect.Message

func (*EchoResponse) Reset

func (x *EchoResponse) Reset()

func (*EchoResponse) String

func (x *EchoResponse) String() string

type FaultyError

type FaultyError struct {

	// RPC error code. MUST be a valid code value registered in the
	// google.golang.org/grpc/codes package.
	Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	// General description of the error.
	Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"`
	// Custom key/value pairs providing additional details about the error.
	Metadata map[string]string `` /* 157-byte string literal not displayed */
	// contains filtered or unexported fields
}

Custom error type returned by the `Faulty` RPC method.

func (*FaultyError) Descriptor deprecated

func (*FaultyError) Descriptor() ([]byte, []int)

Deprecated: Use FaultyError.ProtoReflect.Descriptor instead.

func (*FaultyError) Error

func (x *FaultyError) Error() string

Error returns a textual representation of the `FaultyError` instance. Making sure `FaultyError` can be used as an `error` value.

func (*FaultyError) GetCode

func (x *FaultyError) GetCode() uint32

func (*FaultyError) GetDesc

func (x *FaultyError) GetDesc() string

func (*FaultyError) GetMetadata

func (x *FaultyError) GetMetadata() map[string]string

func (*FaultyError) ProtoMessage

func (*FaultyError) ProtoMessage()

func (*FaultyError) ProtoReflect

func (x *FaultyError) ProtoReflect() protoreflect.Message

func (*FaultyError) Reset

func (x *FaultyError) Reset()

func (*FaultyError) String

func (x *FaultyError) String() string

type FooAPIClient

type FooAPIClient interface {
	// Reachability test.
	Ping(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Pong, error)
	// Health test.
	Health(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*HealthResponse, error)
	// Sample request.
	Request(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Response, error)
	// Returns an error roughly about 20% of the time.
	Faulty(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*DummyResponse, error)
	// Exhibit a random latency between 10 and 200ms.
	Slow(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*DummyResponse, error)
	// Sample server stream request.
	OpenServerStream(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (FooAPI_OpenServerStreamClient, error)
	// Sample client stream request.
	OpenClientStream(ctx context.Context, opts ...grpc.CallOption) (FooAPI_OpenClientStreamClient, error)
}

FooAPIClient is the client API for FooAPI service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewFooAPIClient

func NewFooAPIClient(cc grpc.ClientConnInterface) FooAPIClient

type FooAPIServer

type FooAPIServer interface {
	// Reachability test.
	Ping(context.Context, *emptypb.Empty) (*Pong, error)
	// Health test.
	Health(context.Context, *emptypb.Empty) (*HealthResponse, error)
	// Sample request.
	Request(context.Context, *emptypb.Empty) (*Response, error)
	// Returns an error roughly about 20% of the time.
	Faulty(context.Context, *emptypb.Empty) (*DummyResponse, error)
	// Exhibit a random latency between 10 and 200ms.
	Slow(context.Context, *emptypb.Empty) (*DummyResponse, error)
	// Sample server stream request.
	OpenServerStream(*emptypb.Empty, FooAPI_OpenServerStreamServer) error
	// Sample client stream request.
	OpenClientStream(FooAPI_OpenClientStreamServer) error
	// contains filtered or unexported methods
}

FooAPIServer is the server API for FooAPI service. All implementations must embed UnimplementedFooAPIServer for forward compatibility

type FooAPI_OpenClientStreamClient

type FooAPI_OpenClientStreamClient interface {
	Send(*OpenClientStreamRequest) error
	CloseAndRecv() (*StreamResult, error)
	grpc.ClientStream
}

type FooAPI_OpenClientStreamServer

type FooAPI_OpenClientStreamServer interface {
	SendAndClose(*StreamResult) error
	Recv() (*OpenClientStreamRequest, error)
	grpc.ServerStream
}

type FooAPI_OpenServerStreamClient

type FooAPI_OpenServerStreamClient interface {
	Recv() (*GenericStreamChunk, error)
	grpc.ClientStream
}

type FooAPI_OpenServerStreamServer

type FooAPI_OpenServerStreamServer interface {
	Send(*GenericStreamChunk) error
	grpc.ServerStream
}

type GenericStreamChunk

type GenericStreamChunk struct {

	// Identifier for the endpoint generating the stream message.
	Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
	// Message generation UNIX timestamp.
	Stamp int64 `protobuf:"varint,2,opt,name=stamp,proto3" json:"stamp,omitempty"`
	// contains filtered or unexported fields
}

Generic stream messages returned by the server.

func (*GenericStreamChunk) Descriptor deprecated

func (*GenericStreamChunk) Descriptor() ([]byte, []int)

Deprecated: Use GenericStreamChunk.ProtoReflect.Descriptor instead.

func (*GenericStreamChunk) GetSender

func (x *GenericStreamChunk) GetSender() string

func (*GenericStreamChunk) GetStamp

func (x *GenericStreamChunk) GetStamp() int64

func (*GenericStreamChunk) ProtoMessage

func (*GenericStreamChunk) ProtoMessage()

func (*GenericStreamChunk) ProtoReflect

func (x *GenericStreamChunk) ProtoReflect() protoreflect.Message

func (*GenericStreamChunk) Reset

func (x *GenericStreamChunk) Reset()

func (*GenericStreamChunk) String

func (x *GenericStreamChunk) String() string

type Handler

Handler provides a simple test server.

func (*Handler) Faulty

func (s *Handler) Faulty(_ context.Context, _ *empty.Empty) (*DummyResponse, error)

Faulty will return an error about 20% of the time.

func (*Handler) Health

func (s *Handler) Health(_ context.Context, _ *empty.Empty) (*HealthResponse, error)

Health provides a sample health check method.

func (*Handler) OpenClientStream

func (s *Handler) OpenClientStream(stream FooAPI_OpenClientStreamServer) (err error)

OpenClientStream starts a streaming operation on the client side.

func (*Handler) OpenServerStream

func (s *Handler) OpenServerStream(_ *empty.Empty, stream FooAPI_OpenServerStreamServer) error

OpenServerStream starts a streaming operation on the server side.

func (*Handler) Ping

func (s *Handler) Ping(_ context.Context, _ *empty.Empty) (*Pong, error)

Ping provides a sample reachability test method.

func (*Handler) Request

func (s *Handler) Request(ctx context.Context, _ *empty.Empty) (*Response, error)

Request provides a sample request handler. If a `sticky-metadata` value is provided it will be returned to the client.

func (*Handler) Slow

func (s *Handler) Slow(_ context.Context, _ *empty.Empty) (*DummyResponse, error)

Slow will report a random latency between 10 to 200ms.

type HealthResponse

type HealthResponse struct {

	// Generic availability check, set to 'false' in case of errors.
	Alive bool `protobuf:"varint,1,opt,name=alive,proto3" json:"alive,omitempty"`
	// contains filtered or unexported fields
}

Health test response.

func (*HealthResponse) Descriptor deprecated

func (*HealthResponse) Descriptor() ([]byte, []int)

Deprecated: Use HealthResponse.ProtoReflect.Descriptor instead.

func (*HealthResponse) GetAlive

func (x *HealthResponse) GetAlive() bool

func (*HealthResponse) ProtoMessage

func (*HealthResponse) ProtoMessage()

func (*HealthResponse) ProtoReflect

func (x *HealthResponse) ProtoReflect() protoreflect.Message

func (*HealthResponse) Reset

func (x *HealthResponse) Reset()

func (*HealthResponse) String

func (x *HealthResponse) String() string

type OpenClientStreamRequest

type OpenClientStreamRequest struct {

	// Identifier for the endpoint generating the stream message.
	Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
	// Message generation UNIX timestamp.
	Stamp int64 `protobuf:"varint,2,opt,name=stamp,proto3" json:"stamp,omitempty"`
	// contains filtered or unexported fields
}

Generic stream messages send by the client.

func (*OpenClientStreamRequest) Descriptor deprecated

func (*OpenClientStreamRequest) Descriptor() ([]byte, []int)

Deprecated: Use OpenClientStreamRequest.ProtoReflect.Descriptor instead.

func (*OpenClientStreamRequest) GetSender

func (x *OpenClientStreamRequest) GetSender() string

func (*OpenClientStreamRequest) GetStamp

func (x *OpenClientStreamRequest) GetStamp() int64

func (*OpenClientStreamRequest) ProtoMessage

func (*OpenClientStreamRequest) ProtoMessage()

func (*OpenClientStreamRequest) ProtoReflect

func (x *OpenClientStreamRequest) ProtoReflect() protoreflect.Message

func (*OpenClientStreamRequest) Reset

func (x *OpenClientStreamRequest) Reset()

func (*OpenClientStreamRequest) String

func (x *OpenClientStreamRequest) String() string

type Pong

type Pong struct {

	// Whether the service is 'ready-for-use'
	Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
	// contains filtered or unexported fields
}

Reachability test response.

func (*Pong) Descriptor deprecated

func (*Pong) Descriptor() ([]byte, []int)

Deprecated: Use Pong.ProtoReflect.Descriptor instead.

func (*Pong) GetOk

func (x *Pong) GetOk() bool

func (*Pong) ProtoMessage

func (*Pong) ProtoMessage()

func (*Pong) ProtoReflect

func (x *Pong) ProtoReflect() protoreflect.Message

func (*Pong) Reset

func (x *Pong) Reset()

func (*Pong) String

func (x *Pong) String() string

type Response

type Response struct {

	// A key on the entity
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

Generic request response.

func (*Response) Descriptor deprecated

func (*Response) Descriptor() ([]byte, []int)

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetName

func (x *Response) GetName() string

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

func (x *Response) ProtoReflect() protoreflect.Message

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

type StreamResult

type StreamResult struct {

	// Set to the total number of messages received during the request.
	Received int64 `protobuf:"varint,1,opt,name=received,proto3" json:"received,omitempty"`
	// contains filtered or unexported fields
}

Generic stream result.

func (*StreamResult) Descriptor deprecated

func (*StreamResult) Descriptor() ([]byte, []int)

Deprecated: Use StreamResult.ProtoReflect.Descriptor instead.

func (*StreamResult) GetReceived

func (x *StreamResult) GetReceived() int64

func (*StreamResult) ProtoMessage

func (*StreamResult) ProtoMessage()

func (*StreamResult) ProtoReflect

func (x *StreamResult) ProtoReflect() protoreflect.Message

func (*StreamResult) Reset

func (x *StreamResult) Reset()

func (*StreamResult) String

func (x *StreamResult) String() string

type UnimplementedBarAPIServer

type UnimplementedBarAPIServer struct {
}

UnimplementedBarAPIServer must be embedded to have forward compatible implementations.

func (UnimplementedBarAPIServer) Health

func (UnimplementedBarAPIServer) Ping

func (UnimplementedBarAPIServer) Request

type UnimplementedEchoAPIServer

type UnimplementedEchoAPIServer struct {
}

UnimplementedEchoAPIServer must be embedded to have forward compatible implementations.

func (UnimplementedEchoAPIServer) Echo

func (UnimplementedEchoAPIServer) Faulty

func (UnimplementedEchoAPIServer) Health

func (UnimplementedEchoAPIServer) Ping

func (UnimplementedEchoAPIServer) Slow

type UnimplementedFooAPIServer

type UnimplementedFooAPIServer struct {
}

UnimplementedFooAPIServer must be embedded to have forward compatible implementations.

func (UnimplementedFooAPIServer) Faulty

func (UnimplementedFooAPIServer) Health

func (UnimplementedFooAPIServer) OpenClientStream

func (UnimplementedFooAPIServer) OpenServerStream

func (UnimplementedFooAPIServer) Ping

func (UnimplementedFooAPIServer) Request

func (UnimplementedFooAPIServer) Slow

type UnsafeBarAPIServer

type UnsafeBarAPIServer interface {
	// contains filtered or unexported methods
}

UnsafeBarAPIServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BarAPIServer will result in compilation errors.

type UnsafeEchoAPIServer

type UnsafeEchoAPIServer interface {
	// contains filtered or unexported methods
}

UnsafeEchoAPIServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EchoAPIServer will result in compilation errors.

type UnsafeFooAPIServer

type UnsafeFooAPIServer interface {
	// contains filtered or unexported methods
}

UnsafeFooAPIServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to FooAPIServer will result in compilation errors.

Jump to

Keyboard shortcuts

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