Documentation
¶
Overview ¶
Package ticket is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterTicketServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterTicketServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TicketServiceClient) error
- func RegisterTicketServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterTicketServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TicketServiceServer) error
- func RegisterTicketServiceServer(s grpc.ServiceRegistrar, srv TicketServiceServer)
- type CreateTicketRequest
- func (*CreateTicketRequest) Descriptor() ([]byte, []int)deprecated
- func (*CreateTicketRequest) ProtoMessage()
- func (x *CreateTicketRequest) ProtoReflect() protoreflect.Message
- func (x *CreateTicketRequest) Reset()
- func (x *CreateTicketRequest) String() string
- func (m *CreateTicketRequest) Validate() error
- type CreateTicketRequestValidationError
- func (e CreateTicketRequestValidationError) Cause() error
- func (e CreateTicketRequestValidationError) Error() string
- func (e CreateTicketRequestValidationError) ErrorName() string
- func (e CreateTicketRequestValidationError) Field() string
- func (e CreateTicketRequestValidationError) Key() bool
- func (e CreateTicketRequestValidationError) Reason() string
- type CreateTicketResponse
- func (*CreateTicketResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CreateTicketResponse) GetData() *v1.CreateTicketResponse
- func (*CreateTicketResponse) ProtoMessage()
- func (x *CreateTicketResponse) ProtoReflect() protoreflect.Message
- func (x *CreateTicketResponse) Reset()
- func (x *CreateTicketResponse) String() string
- func (m *CreateTicketResponse) Validate() error
- type CreateTicketResponseValidationError
- func (e CreateTicketResponseValidationError) Cause() error
- func (e CreateTicketResponseValidationError) Error() string
- func (e CreateTicketResponseValidationError) ErrorName() string
- func (e CreateTicketResponseValidationError) Field() string
- func (e CreateTicketResponseValidationError) Key() bool
- func (e CreateTicketResponseValidationError) Reason() string
- type StatusResponse
- func (*StatusResponse) Descriptor() ([]byte, []int)deprecated
- func (x *StatusResponse) GetMessage() string
- func (*StatusResponse) ProtoMessage()
- func (x *StatusResponse) ProtoReflect() protoreflect.Message
- func (x *StatusResponse) Reset()
- func (x *StatusResponse) String() string
- func (m *StatusResponse) Validate() error
- type StatusResponseValidationError
- func (e StatusResponseValidationError) Cause() error
- func (e StatusResponseValidationError) Error() string
- func (e StatusResponseValidationError) ErrorName() string
- func (e StatusResponseValidationError) Field() string
- func (e StatusResponseValidationError) Key() bool
- func (e StatusResponseValidationError) Reason() string
- type TicketServiceClient
- type TicketServiceServer
- type UnimplementedTicketServiceServer
- type UnsafeTicketServiceServer
Constants ¶
const ( TicketService_Status_FullMethodName = "/tickex.ticket.v1.TicketService/Status" TicketService_CreateTicket_FullMethodName = "/tickex.ticket.v1.TicketService/CreateTicket" )
Variables ¶
var File_ticket_proto protoreflect.FileDescriptor
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 ¶
func (e CreateTicketRequestValidationError) Cause() error
Cause function returns cause value.
func (CreateTicketRequestValidationError) Error ¶
func (e CreateTicketRequestValidationError) Error() string
Error satisfies the builtin error interface
func (CreateTicketRequestValidationError) ErrorName ¶
func (e CreateTicketRequestValidationError) ErrorName() string
ErrorName returns error name.
func (CreateTicketRequestValidationError) Field ¶
func (e CreateTicketRequestValidationError) Field() string
Field function returns field value.
func (CreateTicketRequestValidationError) Key ¶
func (e CreateTicketRequestValidationError) Key() bool
Key function returns key value.
func (CreateTicketRequestValidationError) Reason ¶
func (e CreateTicketRequestValidationError) Reason() string
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 (x *CreateTicketResponse) GetData() *v1.CreateTicketResponse
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 ¶
func (e CreateTicketResponseValidationError) Cause() error
Cause function returns cause value.
func (CreateTicketResponseValidationError) Error ¶
func (e CreateTicketResponseValidationError) Error() string
Error satisfies the builtin error interface
func (CreateTicketResponseValidationError) ErrorName ¶
func (e CreateTicketResponseValidationError) ErrorName() string
ErrorName returns error name.
func (CreateTicketResponseValidationError) Field ¶
func (e CreateTicketResponseValidationError) Field() string
Field function returns field value.
func (CreateTicketResponseValidationError) Key ¶
func (e CreateTicketResponseValidationError) Key() bool
Key function returns key value.
func (CreateTicketResponseValidationError) Reason ¶
func (e CreateTicketResponseValidationError) Reason() string
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 ¶
func (e StatusResponseValidationError) Cause() error
Cause function returns cause value.
func (StatusResponseValidationError) Error ¶
func (e StatusResponseValidationError) Error() string
Error satisfies the builtin error interface
func (StatusResponseValidationError) ErrorName ¶
func (e StatusResponseValidationError) ErrorName() string
ErrorName returns error name.
func (StatusResponseValidationError) Field ¶
func (e StatusResponseValidationError) Field() string
Field function returns field value.
func (StatusResponseValidationError) Key ¶
func (e StatusResponseValidationError) Key() bool
Key function returns key value.
func (StatusResponseValidationError) Reason ¶
func (e StatusResponseValidationError) Reason() string
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.
func NewTicketServiceClient ¶
func NewTicketServiceClient(cc grpc.ClientConnInterface) TicketServiceClient
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) CreateTicket(context.Context, *CreateTicketRequest) (*CreateTicketResponse, error)
func (UnimplementedTicketServiceServer) Status ¶
func (UnimplementedTicketServiceServer) Status(context.Context, *emptypb.Empty) (*StatusResponse, error)
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.