Documentation ¶
Index ¶
- Constants
- func NewTicketingServiceHandler(svc TicketingServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type TicketingServiceClient
- type TicketingServiceHandler
- type UnimplementedTicketingServiceHandler
- func (UnimplementedTicketingServiceHandler) AddComment(context.Context, *connect.Request[v1.AddCommentRequest]) (*connect.Response[v1.AddCommentResponse], error)
- func (UnimplementedTicketingServiceHandler) CreateTicket(context.Context, *connect.Request[v1.CreateTicketRequest]) (*connect.Response[v1.CreateTicketResponse], error)
- func (UnimplementedTicketingServiceHandler) GetTicketByID(context.Context, *connect.Request[v1.GetTicketByIDRequest]) (*connect.Response[v1.GetTicketByIDResponse], error)
- func (UnimplementedTicketingServiceHandler) ListTickets(context.Context, *connect.Request[v1.ListTicketsRequest]) (*connect.Response[v1.ListTicketsResponse], error)
- func (UnimplementedTicketingServiceHandler) UpdateTicketStatus(context.Context, *connect.Request[v1.UpdateTicketStatusRequest]) (*connect.Response[v1.UpdateTicketStatusResponse], error)
Constants ¶
const ( // TicketingServiceCreateTicketProcedure is the fully-qualified name of the TicketingService's // CreateTicket RPC. TicketingServiceCreateTicketProcedure = "/tests.go.samples.ticketing_system.v1.TicketingService/CreateTicket" // TicketingServiceGetTicketByIDProcedure is the fully-qualified name of the TicketingService's // GetTicketByID RPC. TicketingServiceGetTicketByIDProcedure = "/tests.go.samples.ticketing_system.v1.TicketingService/GetTicketByID" // TicketingServiceListTicketsProcedure is the fully-qualified name of the TicketingService's // ListTickets RPC. TicketingServiceListTicketsProcedure = "/tests.go.samples.ticketing_system.v1.TicketingService/ListTickets" // TicketingServiceAddCommentProcedure is the fully-qualified name of the TicketingService's // AddComment RPC. TicketingServiceAddCommentProcedure = "/tests.go.samples.ticketing_system.v1.TicketingService/AddComment" // TicketingServiceUpdateTicketStatusProcedure is the fully-qualified name of the TicketingService's // UpdateTicketStatus RPC. TicketingServiceUpdateTicketStatusProcedure = "/tests.go.samples.ticketing_system.v1.TicketingService/UpdateTicketStatus" )
These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.
const (
// TicketingServiceName is the fully-qualified name of the TicketingService service.
TicketingServiceName = "tests.go.samples.ticketing_system.v1.TicketingService"
)
Variables ¶
This section is empty.
Functions ¶
func NewTicketingServiceHandler ¶
func NewTicketingServiceHandler(svc TicketingServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewTicketingServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.
By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.
Types ¶
type TicketingServiceClient ¶
type TicketingServiceClient interface { // CreateTicket creates a new support ticket CreateTicket(context.Context, *connect.Request[v1.CreateTicketRequest]) (*connect.Response[v1.CreateTicketResponse], error) // GetTicketByID retrieves a support ticket by its ID GetTicketByID(context.Context, *connect.Request[v1.GetTicketByIDRequest]) (*connect.Response[v1.GetTicketByIDResponse], error) // ListTickets lists all support tickets ListTickets(context.Context, *connect.Request[v1.ListTicketsRequest]) (*connect.Response[v1.ListTicketsResponse], error) // AddComment adds a comment to a ticket AddComment(context.Context, *connect.Request[v1.AddCommentRequest]) (*connect.Response[v1.AddCommentResponse], error) // UpdateTicketStatus updates the status of a ticket UpdateTicketStatus(context.Context, *connect.Request[v1.UpdateTicketStatusRequest]) (*connect.Response[v1.UpdateTicketStatusResponse], error) }
TicketingServiceClient is a client for the tests.go.samples.ticketing_system.v1.TicketingService service.
func NewTicketingServiceClient ¶
func NewTicketingServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) TicketingServiceClient
NewTicketingServiceClient constructs a client for the tests.go.samples.ticketing_system.v1.TicketingService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.
The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).
type TicketingServiceHandler ¶
type TicketingServiceHandler interface { // CreateTicket creates a new support ticket CreateTicket(context.Context, *connect.Request[v1.CreateTicketRequest]) (*connect.Response[v1.CreateTicketResponse], error) // GetTicketByID retrieves a support ticket by its ID GetTicketByID(context.Context, *connect.Request[v1.GetTicketByIDRequest]) (*connect.Response[v1.GetTicketByIDResponse], error) // ListTickets lists all support tickets ListTickets(context.Context, *connect.Request[v1.ListTicketsRequest]) (*connect.Response[v1.ListTicketsResponse], error) // AddComment adds a comment to a ticket AddComment(context.Context, *connect.Request[v1.AddCommentRequest]) (*connect.Response[v1.AddCommentResponse], error) // UpdateTicketStatus updates the status of a ticket UpdateTicketStatus(context.Context, *connect.Request[v1.UpdateTicketStatusRequest]) (*connect.Response[v1.UpdateTicketStatusResponse], error) }
TicketingServiceHandler is an implementation of the tests.go.samples.ticketing_system.v1.TicketingService service.
type UnimplementedTicketingServiceHandler ¶
type UnimplementedTicketingServiceHandler struct{}
UnimplementedTicketingServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedTicketingServiceHandler) AddComment ¶
func (UnimplementedTicketingServiceHandler) AddComment(context.Context, *connect.Request[v1.AddCommentRequest]) (*connect.Response[v1.AddCommentResponse], error)
func (UnimplementedTicketingServiceHandler) CreateTicket ¶
func (UnimplementedTicketingServiceHandler) CreateTicket(context.Context, *connect.Request[v1.CreateTicketRequest]) (*connect.Response[v1.CreateTicketResponse], error)
func (UnimplementedTicketingServiceHandler) GetTicketByID ¶
func (UnimplementedTicketingServiceHandler) GetTicketByID(context.Context, *connect.Request[v1.GetTicketByIDRequest]) (*connect.Response[v1.GetTicketByIDResponse], error)
func (UnimplementedTicketingServiceHandler) ListTickets ¶
func (UnimplementedTicketingServiceHandler) ListTickets(context.Context, *connect.Request[v1.ListTicketsRequest]) (*connect.Response[v1.ListTicketsResponse], error)
func (UnimplementedTicketingServiceHandler) UpdateTicketStatus ¶
func (UnimplementedTicketingServiceHandler) UpdateTicketStatus(context.Context, *connect.Request[v1.UpdateTicketStatusRequest]) (*connect.Response[v1.UpdateTicketStatusResponse], error)