ticketing_systemv1connect

package
v0.0.0-...-a04e50b Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
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.

View Source
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.

Jump to

Keyboard shortcuts

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