generated

package
v2.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package generated contains the generated code for gRPC client and server stubs, and an OpenAPIv2 (swagger) JSON declaration, from protobuf source(s).

Index

Constants

View Source
const (
	PiService_GetDigit_FullMethodName = "/pi.v2.PiService/GetDigit"
)

Variables

View Source
var File_pi_v2_pi_proto protoreflect.FileDescriptor
View Source
var PiService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pi.v2.PiService",
	HandlerType: (*PiServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetDigit",
			Handler:    _PiService_GetDigit_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "pi/v2/pi.proto",
}

PiService_ServiceDesc is the grpc.ServiceDesc for PiService 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 SwaggerJSON []byte

SwaggerJSON contains the generated OpenAPIv2 (swagger) declaration exposed by REST endpoint.

Functions

func RegisterPiServiceHandler

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

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

func RegisterPiServiceHandlerClient

func RegisterPiServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PiServiceClient) error

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

func RegisterPiServiceHandlerFromEndpoint

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

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

func RegisterPiServiceHandlerServer

func RegisterPiServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PiServiceServer) error

RegisterPiServiceHandlerServer registers the http handlers for service PiService to "mux". UnaryRPC :call PiServiceServer 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 RegisterPiServiceHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.

func RegisterPiServiceServer

func RegisterPiServiceServer(s grpc.ServiceRegistrar, srv PiServiceServer)

Types

type GetDigitMetadata

type GetDigitMetadata struct {

	// Identity of the pi server; usually the hostname as reported by OS.
	Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"`
	// List of string tags that were provided by the Pi Service configuration.
	Tags []string `protobuf:"bytes,2,rep,name=tags,proto3" json:"tags,omitempty"`
	// Map of key:value string pairs that were provided by the Pi Service configuration.
	Annotations map[string]string `` /* 163-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*GetDigitMetadata) Descriptor deprecated

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

Deprecated: Use GetDigitMetadata.ProtoReflect.Descriptor instead.

func (*GetDigitMetadata) GetAnnotations

func (x *GetDigitMetadata) GetAnnotations() map[string]string

func (*GetDigitMetadata) GetIdentity

func (x *GetDigitMetadata) GetIdentity() string

func (*GetDigitMetadata) GetTags

func (x *GetDigitMetadata) GetTags() []string

func (*GetDigitMetadata) ProtoMessage

func (*GetDigitMetadata) ProtoMessage()

func (*GetDigitMetadata) ProtoReflect

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

func (*GetDigitMetadata) Reset

func (x *GetDigitMetadata) Reset()

func (*GetDigitMetadata) String

func (x *GetDigitMetadata) String() string

type GetDigitRequest

type GetDigitRequest struct {

	// Zero-based index of the fractional digit of pi to return.
	Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
	// contains filtered or unexported fields
}

func (*GetDigitRequest) Descriptor deprecated

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

Deprecated: Use GetDigitRequest.ProtoReflect.Descriptor instead.

func (*GetDigitRequest) GetIndex

func (x *GetDigitRequest) GetIndex() uint64

func (*GetDigitRequest) ProtoMessage

func (*GetDigitRequest) ProtoMessage()

func (*GetDigitRequest) ProtoReflect

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

func (*GetDigitRequest) Reset

func (x *GetDigitRequest) Reset()

func (*GetDigitRequest) String

func (x *GetDigitRequest) String() string

type GetDigitResponse

type GetDigitResponse struct {

	// Zero-based index of the fractional digit of pi being returned.
	Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
	// Fractional digit of pi at request offset; this is always an unsigned integer
	// between 0 and 9 inclusive
	Digit uint32 `protobuf:"varint,2,opt,name=digit,proto3" json:"digit,omitempty"`
	// Metadata from the pi service that handled the request
	Metadata *GetDigitMetadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// contains filtered or unexported fields
}

func (*GetDigitResponse) Descriptor deprecated

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

Deprecated: Use GetDigitResponse.ProtoReflect.Descriptor instead.

func (*GetDigitResponse) GetDigit

func (x *GetDigitResponse) GetDigit() uint32

func (*GetDigitResponse) GetIndex

func (x *GetDigitResponse) GetIndex() uint64

func (*GetDigitResponse) GetMetadata

func (x *GetDigitResponse) GetMetadata() *GetDigitMetadata

func (*GetDigitResponse) ProtoMessage

func (*GetDigitResponse) ProtoMessage()

func (*GetDigitResponse) ProtoReflect

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

func (*GetDigitResponse) Reset

func (x *GetDigitResponse) Reset()

func (*GetDigitResponse) String

func (x *GetDigitResponse) String() string

type PiServiceClient

type PiServiceClient interface {
	GetDigit(ctx context.Context, in *GetDigitRequest, opts ...grpc.CallOption) (*GetDigitResponse, error)
}

PiServiceClient is the client API for PiService 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 NewPiServiceClient

func NewPiServiceClient(cc grpc.ClientConnInterface) PiServiceClient

type PiServiceServer

type PiServiceServer interface {
	GetDigit(context.Context, *GetDigitRequest) (*GetDigitResponse, error)
	// contains filtered or unexported methods
}

PiServiceServer is the server API for PiService service. All implementations must embed UnimplementedPiServiceServer for forward compatibility.

type UnimplementedPiServiceServer

type UnimplementedPiServiceServer struct{}

UnimplementedPiServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedPiServiceServer) GetDigit

type UnsafePiServiceServer

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

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

Jump to

Keyboard shortcuts

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