puzzle_serviceconnect

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// PuzzleServiceGetStartPuzzleIdProcedure is the fully-qualified name of the PuzzleService's
	// GetStartPuzzleId RPC.
	PuzzleServiceGetStartPuzzleIdProcedure = "/puzzle_service.PuzzleService/GetStartPuzzleId"
	// PuzzleServiceGetNextPuzzleIdProcedure is the fully-qualified name of the PuzzleService's
	// GetNextPuzzleId RPC.
	PuzzleServiceGetNextPuzzleIdProcedure = "/puzzle_service.PuzzleService/GetNextPuzzleId"
	// PuzzleServiceGetNextClosestRatingPuzzleIdProcedure is the fully-qualified name of the
	// PuzzleService's GetNextClosestRatingPuzzleId RPC.
	PuzzleServiceGetNextClosestRatingPuzzleIdProcedure = "/puzzle_service.PuzzleService/GetNextClosestRatingPuzzleId"
	// PuzzleServiceGetPuzzleProcedure is the fully-qualified name of the PuzzleService's GetPuzzle RPC.
	PuzzleServiceGetPuzzleProcedure = "/puzzle_service.PuzzleService/GetPuzzle"
	// PuzzleServiceSubmitAnswerProcedure is the fully-qualified name of the PuzzleService's
	// SubmitAnswer RPC.
	PuzzleServiceSubmitAnswerProcedure = "/puzzle_service.PuzzleService/SubmitAnswer"
	// PuzzleServiceGetPuzzleAnswerProcedure is the fully-qualified name of the PuzzleService's
	// GetPuzzleAnswer RPC.
	PuzzleServiceGetPuzzleAnswerProcedure = "/puzzle_service.PuzzleService/GetPuzzleAnswer"
	// PuzzleServiceGetPreviousPuzzleIdProcedure is the fully-qualified name of the PuzzleService's
	// GetPreviousPuzzleId RPC.
	PuzzleServiceGetPreviousPuzzleIdProcedure = "/puzzle_service.PuzzleService/GetPreviousPuzzleId"
	// PuzzleServiceSetPuzzleVoteProcedure is the fully-qualified name of the PuzzleService's
	// SetPuzzleVote RPC.
	PuzzleServiceSetPuzzleVoteProcedure = "/puzzle_service.PuzzleService/SetPuzzleVote"
	// PuzzleServiceStartPuzzleGenJobProcedure is the fully-qualified name of the PuzzleService's
	// StartPuzzleGenJob RPC.
	PuzzleServiceStartPuzzleGenJobProcedure = "/puzzle_service.PuzzleService/StartPuzzleGenJob"
	// PuzzleServiceGetPuzzleJobLogsProcedure is the fully-qualified name of the PuzzleService's
	// GetPuzzleJobLogs RPC.
	PuzzleServiceGetPuzzleJobLogsProcedure = "/puzzle_service.PuzzleService/GetPuzzleJobLogs"
)

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 (
	// PuzzleServiceName is the fully-qualified name of the PuzzleService service.
	PuzzleServiceName = "puzzle_service.PuzzleService"
)

Variables

This section is empty.

Functions

func NewPuzzleServiceHandler

func NewPuzzleServiceHandler(svc PuzzleServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewPuzzleServiceHandler 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 PuzzleServiceClient

type PuzzleServiceClient interface {
	GetStartPuzzleId(context.Context, *connect.Request[puzzle_service.StartPuzzleIdRequest]) (*connect.Response[puzzle_service.StartPuzzleIdResponse], error)
	GetNextPuzzleId(context.Context, *connect.Request[puzzle_service.NextPuzzleIdRequest]) (*connect.Response[puzzle_service.NextPuzzleIdResponse], error)
	GetNextClosestRatingPuzzleId(context.Context, *connect.Request[puzzle_service.NextClosestRatingPuzzleIdRequest]) (*connect.Response[puzzle_service.NextClosestRatingPuzzleIdResponse], error)
	GetPuzzle(context.Context, *connect.Request[puzzle_service.PuzzleRequest]) (*connect.Response[puzzle_service.PuzzleResponse], error)
	SubmitAnswer(context.Context, *connect.Request[puzzle_service.SubmissionRequest]) (*connect.Response[puzzle_service.SubmissionResponse], error)
	// GetPuzzleAnswer just gets the answer of the puzzle without a submission.
	// It will not work if the user has not tried the puzzle at least once.
	GetPuzzleAnswer(context.Context, *connect.Request[puzzle_service.PuzzleRequest]) (*connect.Response[puzzle_service.AnswerResponse], error)
	GetPreviousPuzzleId(context.Context, *connect.Request[puzzle_service.PreviousPuzzleRequest]) (*connect.Response[puzzle_service.PreviousPuzzleResponse], error)
	SetPuzzleVote(context.Context, *connect.Request[puzzle_service.PuzzleVoteRequest]) (*connect.Response[puzzle_service.PuzzleVoteResponse], error)
	StartPuzzleGenJob(context.Context, *connect.Request[puzzle_service.APIPuzzleGenerationJobRequest]) (*connect.Response[puzzle_service.APIPuzzleGenerationJobResponse], error)
	GetPuzzleJobLogs(context.Context, *connect.Request[puzzle_service.PuzzleJobLogsRequest]) (*connect.Response[puzzle_service.PuzzleJobLogsResponse], error)
}

PuzzleServiceClient is a client for the puzzle_service.PuzzleService service.

func NewPuzzleServiceClient

func NewPuzzleServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) PuzzleServiceClient

NewPuzzleServiceClient constructs a client for the puzzle_service.PuzzleService 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 PuzzleServiceHandler

type PuzzleServiceHandler interface {
	GetStartPuzzleId(context.Context, *connect.Request[puzzle_service.StartPuzzleIdRequest]) (*connect.Response[puzzle_service.StartPuzzleIdResponse], error)
	GetNextPuzzleId(context.Context, *connect.Request[puzzle_service.NextPuzzleIdRequest]) (*connect.Response[puzzle_service.NextPuzzleIdResponse], error)
	GetNextClosestRatingPuzzleId(context.Context, *connect.Request[puzzle_service.NextClosestRatingPuzzleIdRequest]) (*connect.Response[puzzle_service.NextClosestRatingPuzzleIdResponse], error)
	GetPuzzle(context.Context, *connect.Request[puzzle_service.PuzzleRequest]) (*connect.Response[puzzle_service.PuzzleResponse], error)
	SubmitAnswer(context.Context, *connect.Request[puzzle_service.SubmissionRequest]) (*connect.Response[puzzle_service.SubmissionResponse], error)
	// GetPuzzleAnswer just gets the answer of the puzzle without a submission.
	// It will not work if the user has not tried the puzzle at least once.
	GetPuzzleAnswer(context.Context, *connect.Request[puzzle_service.PuzzleRequest]) (*connect.Response[puzzle_service.AnswerResponse], error)
	GetPreviousPuzzleId(context.Context, *connect.Request[puzzle_service.PreviousPuzzleRequest]) (*connect.Response[puzzle_service.PreviousPuzzleResponse], error)
	SetPuzzleVote(context.Context, *connect.Request[puzzle_service.PuzzleVoteRequest]) (*connect.Response[puzzle_service.PuzzleVoteResponse], error)
	StartPuzzleGenJob(context.Context, *connect.Request[puzzle_service.APIPuzzleGenerationJobRequest]) (*connect.Response[puzzle_service.APIPuzzleGenerationJobResponse], error)
	GetPuzzleJobLogs(context.Context, *connect.Request[puzzle_service.PuzzleJobLogsRequest]) (*connect.Response[puzzle_service.PuzzleJobLogsResponse], error)
}

PuzzleServiceHandler is an implementation of the puzzle_service.PuzzleService service.

type UnimplementedPuzzleServiceHandler

type UnimplementedPuzzleServiceHandler struct{}

UnimplementedPuzzleServiceHandler returns CodeUnimplemented from all methods.

Jump to

Keyboard shortcuts

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