definition

package
v0.0.0-...-abcbab4 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package definition is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	PongV1_Ping_FullMethodName     = "/pong.PongV1/Ping"
	PongV1_Services_FullMethodName = "/pong.PongV1/Services"
)
View Source
const (
	Name = "pong.v1"
)

Variables

View Source
var File_integrations_pong_v1_definition_pong_proto protoreflect.FileDescriptor
View Source
var PongV1_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pong.PongV1",
	HandlerType: (*PongV1Server)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Ping",
			Handler:    _PongV1_Ping_Handler,
		},
		{
			MethodName: "Services",
			Handler:    _PongV1_Services_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "integrations/pong/v1/definition/pong.proto",
}

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

Functions

func RegisterPongV1Handler

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

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

func RegisterPongV1HandlerClient

func RegisterPongV1HandlerClient(ctx context.Context, mux *runtime.ServeMux, client PongV1Client) error

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

func RegisterPongV1HandlerFromEndpoint

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

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

func RegisterPongV1HandlerServer

func RegisterPongV1HandlerServer(ctx context.Context, mux *runtime.ServeMux, server PongV1Server) error

RegisterPongV1HandlerServer registers the http handlers for service PongV1 to "mux". UnaryRPC :call PongV1Server 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 RegisterPongV1HandlerFromEndpoint 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 RegisterPongV1Server

func RegisterPongV1Server(s grpc.ServiceRegistrar, srv PongV1Server)

Types

type PongV1Client

type PongV1Client interface {
	// Sends ping to the server
	Ping(ctx context.Context, in *definition.Empty, opts ...grpc.CallOption) (*PongV1PingResponse, error)
	// Asks for the services details
	Services(ctx context.Context, in *definition.Empty, opts ...grpc.CallOption) (*PongV1ServicesResponse, error)
}

PongV1Client is the client API for PongV1 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.

PongV1 Service implementation

func NewPongV1Client

func NewPongV1Client(cc grpc.ClientConnInterface) PongV1Client

type PongV1PingResponse

type PongV1PingResponse struct {

	// Current time in UTC
	Time *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"`
	// Ticks since the start
	Ticks int32 `protobuf:"varint,2,opt,name=ticks,proto3" json:"ticks,omitempty"`
	// contains filtered or unexported fields
}

PongV1 Ping Call Response

func (*PongV1PingResponse) Descriptor deprecated

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

Deprecated: Use PongV1PingResponse.ProtoReflect.Descriptor instead.

func (*PongV1PingResponse) GetTicks

func (x *PongV1PingResponse) GetTicks() int32

func (*PongV1PingResponse) GetTime

func (*PongV1PingResponse) ProtoMessage

func (*PongV1PingResponse) ProtoMessage()

func (*PongV1PingResponse) ProtoReflect

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

func (*PongV1PingResponse) Reset

func (x *PongV1PingResponse) Reset()

func (*PongV1PingResponse) String

func (x *PongV1PingResponse) String() string

type PongV1Server

type PongV1Server interface {
	// Sends ping to the server
	Ping(context.Context, *definition.Empty) (*PongV1PingResponse, error)
	// Asks for the services details
	Services(context.Context, *definition.Empty) (*PongV1ServicesResponse, error)
	// contains filtered or unexported methods
}

PongV1Server is the server API for PongV1 service. All implementations must embed UnimplementedPongV1Server for forward compatibility.

PongV1 Service implementation

type PongV1Service

type PongV1Service struct {

	// Service Name
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Service Version
	Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	// states if service is enabled
	Enabled bool `protobuf:"varint,3,opt,name=enabled,proto3" json:"enabled,omitempty"`
	// contains filtered or unexported fields
}

Service Definition

func (*PongV1Service) Descriptor deprecated

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

Deprecated: Use PongV1Service.ProtoReflect.Descriptor instead.

func (*PongV1Service) GetEnabled

func (x *PongV1Service) GetEnabled() bool

func (*PongV1Service) GetName

func (x *PongV1Service) GetName() string

func (*PongV1Service) GetVersion

func (x *PongV1Service) GetVersion() string

func (*PongV1Service) ProtoMessage

func (*PongV1Service) ProtoMessage()

func (*PongV1Service) ProtoReflect

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

func (*PongV1Service) Reset

func (x *PongV1Service) Reset()

func (*PongV1Service) String

func (x *PongV1Service) String() string

type PongV1ServicesResponse

type PongV1ServicesResponse struct {

	// List of the Services
	Services []*PongV1Service `protobuf:"bytes,1,rep,name=services,proto3" json:"services,omitempty"`
	// contains filtered or unexported fields
}

PongV1 Services Call Response

func (*PongV1ServicesResponse) Descriptor deprecated

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

Deprecated: Use PongV1ServicesResponse.ProtoReflect.Descriptor instead.

func (*PongV1ServicesResponse) GetServices

func (x *PongV1ServicesResponse) GetServices() []*PongV1Service

func (*PongV1ServicesResponse) ProtoMessage

func (*PongV1ServicesResponse) ProtoMessage()

func (*PongV1ServicesResponse) ProtoReflect

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

func (*PongV1ServicesResponse) Reset

func (x *PongV1ServicesResponse) Reset()

func (*PongV1ServicesResponse) String

func (x *PongV1ServicesResponse) String() string

type UnimplementedPongV1Server

type UnimplementedPongV1Server struct{}

UnimplementedPongV1Server 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 (UnimplementedPongV1Server) Ping

func (UnimplementedPongV1Server) Services

type UnsafePongV1Server

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

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

Jump to

Keyboard shortcuts

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