ticket

package
v0.0.0-...-e08653f Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package ticket is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	TicketService_Status_FullMethodName       = "/tickex.ticket.v1.TicketService/Status"
	TicketService_CreateTicket_FullMethodName = "/tickex.ticket.v1.TicketService/CreateTicket"
)

Variables

View Source
var File_ticket_proto protoreflect.FileDescriptor
View Source
var TicketService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "tickex.ticket.v1.TicketService",
	HandlerType: (*TicketServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Status",
			Handler:    _TicketService_Status_Handler,
		},
		{
			MethodName: "CreateTicket",
			Handler:    _TicketService_CreateTicket_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "ticket.proto",
}

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

Functions

func RegisterTicketServiceHandler

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

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

func RegisterTicketServiceHandlerClient

func RegisterTicketServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TicketServiceClient) error

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

func RegisterTicketServiceHandlerFromEndpoint

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

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

func RegisterTicketServiceHandlerServer

func RegisterTicketServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TicketServiceServer) error

RegisterTicketServiceHandlerServer registers the http handlers for service TicketService to "mux". UnaryRPC :call TicketServiceServer 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 RegisterTicketServiceHandlerFromEndpoint 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 RegisterTicketServiceServer

func RegisterTicketServiceServer(s grpc.ServiceRegistrar, srv TicketServiceServer)

Types

type CreateTicketRequest

type CreateTicketRequest struct {
	// contains filtered or unexported fields
}

func (*CreateTicketRequest) Descriptor deprecated

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

Deprecated: Use CreateTicketRequest.ProtoReflect.Descriptor instead.

func (*CreateTicketRequest) ProtoMessage

func (*CreateTicketRequest) ProtoMessage()

func (*CreateTicketRequest) ProtoReflect

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

func (*CreateTicketRequest) Reset

func (x *CreateTicketRequest) Reset()

func (*CreateTicketRequest) String

func (x *CreateTicketRequest) String() string

func (*CreateTicketRequest) Validate

func (m *CreateTicketRequest) Validate() error

Validate checks the field values on CreateTicketRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type CreateTicketRequestValidationError

type CreateTicketRequestValidationError struct {
	// contains filtered or unexported fields
}

CreateTicketRequestValidationError is the validation error returned by CreateTicketRequest.Validate if the designated constraints aren't met.

func (CreateTicketRequestValidationError) Cause

Cause function returns cause value.

func (CreateTicketRequestValidationError) Error

Error satisfies the builtin error interface

func (CreateTicketRequestValidationError) ErrorName

ErrorName returns error name.

func (CreateTicketRequestValidationError) Field

Field function returns field value.

func (CreateTicketRequestValidationError) Key

Key function returns key value.

func (CreateTicketRequestValidationError) Reason

Reason function returns reason value.

type CreateTicketResponse

type CreateTicketResponse struct {
	Data *v1.CreateTicketResponse `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateTicketResponse) Descriptor deprecated

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

Deprecated: Use CreateTicketResponse.ProtoReflect.Descriptor instead.

func (*CreateTicketResponse) GetData

func (*CreateTicketResponse) ProtoMessage

func (*CreateTicketResponse) ProtoMessage()

func (*CreateTicketResponse) ProtoReflect

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

func (*CreateTicketResponse) Reset

func (x *CreateTicketResponse) Reset()

func (*CreateTicketResponse) String

func (x *CreateTicketResponse) String() string

func (*CreateTicketResponse) Validate

func (m *CreateTicketResponse) Validate() error

Validate checks the field values on CreateTicketResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type CreateTicketResponseValidationError

type CreateTicketResponseValidationError struct {
	// contains filtered or unexported fields
}

CreateTicketResponseValidationError is the validation error returned by CreateTicketResponse.Validate if the designated constraints aren't met.

func (CreateTicketResponseValidationError) Cause

Cause function returns cause value.

func (CreateTicketResponseValidationError) Error

Error satisfies the builtin error interface

func (CreateTicketResponseValidationError) ErrorName

ErrorName returns error name.

func (CreateTicketResponseValidationError) Field

Field function returns field value.

func (CreateTicketResponseValidationError) Key

Key function returns key value.

func (CreateTicketResponseValidationError) Reason

Reason function returns reason value.

type StatusResponse

type StatusResponse struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*StatusResponse) Descriptor deprecated

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

Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead.

func (*StatusResponse) GetMessage

func (x *StatusResponse) GetMessage() string

func (*StatusResponse) ProtoMessage

func (*StatusResponse) ProtoMessage()

func (*StatusResponse) ProtoReflect

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

func (*StatusResponse) Reset

func (x *StatusResponse) Reset()

func (*StatusResponse) String

func (x *StatusResponse) String() string

func (*StatusResponse) Validate

func (m *StatusResponse) Validate() error

Validate checks the field values on StatusResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type StatusResponseValidationError

type StatusResponseValidationError struct {
	// contains filtered or unexported fields
}

StatusResponseValidationError is the validation error returned by StatusResponse.Validate if the designated constraints aren't met.

func (StatusResponseValidationError) Cause

Cause function returns cause value.

func (StatusResponseValidationError) Error

Error satisfies the builtin error interface

func (StatusResponseValidationError) ErrorName

func (e StatusResponseValidationError) ErrorName() string

ErrorName returns error name.

func (StatusResponseValidationError) Field

Field function returns field value.

func (StatusResponseValidationError) Key

Key function returns key value.

func (StatusResponseValidationError) Reason

Reason function returns reason value.

type TicketServiceClient

type TicketServiceClient interface {
	Status(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*StatusResponse, error)
	CreateTicket(ctx context.Context, in *CreateTicketRequest, opts ...grpc.CallOption) (*CreateTicketResponse, error)
}

TicketServiceClient is the client API for TicketService 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 TicketServiceServer

type TicketServiceServer interface {
	Status(context.Context, *emptypb.Empty) (*StatusResponse, error)
	CreateTicket(context.Context, *CreateTicketRequest) (*CreateTicketResponse, error)
	// contains filtered or unexported methods
}

TicketServiceServer is the server API for TicketService service. All implementations must embed UnimplementedTicketServiceServer for forward compatibility.

type UnimplementedTicketServiceServer

type UnimplementedTicketServiceServer struct{}

UnimplementedTicketServiceServer 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 (UnimplementedTicketServiceServer) CreateTicket

func (UnimplementedTicketServiceServer) Status

type UnsafeTicketServiceServer

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

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

Jump to

Keyboard shortcuts

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