ticketgenerator

package
v0.0.0-...-9935248 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package ticketgenerator is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_generator_proto protoreflect.FileDescriptor
View Source
var TicketGenerator_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "transactions.TicketGenerator",
	HandlerType: (*TicketGeneratorServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetTicket",
			Handler:    _TicketGenerator_GetTicket_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "generator.proto",
}

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

Functions

func RegisterTicketGeneratorHandler

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

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

func RegisterTicketGeneratorHandlerClient

func RegisterTicketGeneratorHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TicketGeneratorClient) error

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

func RegisterTicketGeneratorHandlerFromEndpoint

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

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

func RegisterTicketGeneratorHandlerServer

func RegisterTicketGeneratorHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TicketGeneratorServer) error

RegisterTicketGeneratorHandlerServer registers the http handlers for service TicketGenerator to "mux". UnaryRPC :call TicketGeneratorServer 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 RegisterTicketGeneratorHandlerFromEndpoint instead.

func RegisterTicketGeneratorServer

func RegisterTicketGeneratorServer(s grpc.ServiceRegistrar, srv TicketGeneratorServer)

Types

type IDReply

type IDReply struct {
	ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
	// contains filtered or unexported fields
}

func (*IDReply) Descriptor deprecated

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

Deprecated: Use IDReply.ProtoReflect.Descriptor instead.

func (*IDReply) GetID

func (x *IDReply) GetID() int64

func (*IDReply) ProtoMessage

func (*IDReply) ProtoMessage()

func (*IDReply) ProtoReflect

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

func (*IDReply) Reset

func (x *IDReply) Reset()

func (*IDReply) String

func (x *IDReply) String() string

type TicketGeneratorClient

type TicketGeneratorClient interface {
	GetTicket(ctx context.Context, in *TicketRequset, opts ...grpc.CallOption) (*IDReply, error)
}

TicketGeneratorClient is the client API for TicketGenerator 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.

type TicketGeneratorServer

type TicketGeneratorServer interface {
	GetTicket(context.Context, *TicketRequset) (*IDReply, error)
	// contains filtered or unexported methods
}

TicketGeneratorServer is the server API for TicketGenerator service. All implementations must embed UnimplementedTicketGeneratorServer for forward compatibility

type TicketRequset

type TicketRequset struct {
	Time  string  `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"`
	Price float32 `protobuf:"fixed32,2,opt,name=price,proto3" json:"price,omitempty"`
	Seat  int64   `protobuf:"varint,3,opt,name=seat,proto3" json:"seat,omitempty"`
	Id    int64   `protobuf:"varint,4,opt,name=id,proto3" json:"id,omitempty"`
	Title string  `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"`
	// contains filtered or unexported fields
}

func (*TicketRequset) Descriptor deprecated

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

Deprecated: Use TicketRequset.ProtoReflect.Descriptor instead.

func (*TicketRequset) GetId

func (x *TicketRequset) GetId() int64

func (*TicketRequset) GetPrice

func (x *TicketRequset) GetPrice() float32

func (*TicketRequset) GetSeat

func (x *TicketRequset) GetSeat() int64

func (*TicketRequset) GetTime

func (x *TicketRequset) GetTime() string

func (*TicketRequset) GetTitle

func (x *TicketRequset) GetTitle() string

func (*TicketRequset) ProtoMessage

func (*TicketRequset) ProtoMessage()

func (*TicketRequset) ProtoReflect

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

func (*TicketRequset) Reset

func (x *TicketRequset) Reset()

func (*TicketRequset) String

func (x *TicketRequset) String() string

type UnimplementedTicketGeneratorServer

type UnimplementedTicketGeneratorServer struct {
}

UnimplementedTicketGeneratorServer must be embedded to have forward compatible implementations.

func (UnimplementedTicketGeneratorServer) GetTicket

type UnsafeTicketGeneratorServer

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

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

Jump to

Keyboard shortcuts

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