Documentation
¶
Index ¶
- Constants
- func NewPuzzleServiceHandler(svc PuzzleServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type PuzzleServiceClient
- type PuzzleServiceHandler
- type UnimplementedPuzzleServiceHandler
- func (UnimplementedPuzzleServiceHandler) GetNextClosestRatingPuzzleId(context.Context, ...) (*connect.Response[puzzle_service.NextClosestRatingPuzzleIdResponse], error)
- func (UnimplementedPuzzleServiceHandler) GetNextPuzzleId(context.Context, *connect.Request[puzzle_service.NextPuzzleIdRequest]) (*connect.Response[puzzle_service.NextPuzzleIdResponse], error)
- func (UnimplementedPuzzleServiceHandler) GetPreviousPuzzleId(context.Context, *connect.Request[puzzle_service.PreviousPuzzleRequest]) (*connect.Response[puzzle_service.PreviousPuzzleResponse], error)
- func (UnimplementedPuzzleServiceHandler) GetPuzzle(context.Context, *connect.Request[puzzle_service.PuzzleRequest]) (*connect.Response[puzzle_service.PuzzleResponse], error)
- func (UnimplementedPuzzleServiceHandler) GetPuzzleAnswer(context.Context, *connect.Request[puzzle_service.PuzzleRequest]) (*connect.Response[puzzle_service.AnswerResponse], error)
- func (UnimplementedPuzzleServiceHandler) GetPuzzleJobLogs(context.Context, *connect.Request[puzzle_service.PuzzleJobLogsRequest]) (*connect.Response[puzzle_service.PuzzleJobLogsResponse], error)
- func (UnimplementedPuzzleServiceHandler) GetStartPuzzleId(context.Context, *connect.Request[puzzle_service.StartPuzzleIdRequest]) (*connect.Response[puzzle_service.StartPuzzleIdResponse], error)
- func (UnimplementedPuzzleServiceHandler) SetPuzzleVote(context.Context, *connect.Request[puzzle_service.PuzzleVoteRequest]) (*connect.Response[puzzle_service.PuzzleVoteResponse], error)
- func (UnimplementedPuzzleServiceHandler) StartPuzzleGenJob(context.Context, ...) (*connect.Response[puzzle_service.APIPuzzleGenerationJobResponse], error)
- func (UnimplementedPuzzleServiceHandler) SubmitAnswer(context.Context, *connect.Request[puzzle_service.SubmissionRequest]) (*connect.Response[puzzle_service.SubmissionResponse], error)
Constants ¶
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.
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.
func (UnimplementedPuzzleServiceHandler) GetNextClosestRatingPuzzleId ¶
func (UnimplementedPuzzleServiceHandler) GetNextClosestRatingPuzzleId(context.Context, *connect.Request[puzzle_service.NextClosestRatingPuzzleIdRequest]) (*connect.Response[puzzle_service.NextClosestRatingPuzzleIdResponse], error)
func (UnimplementedPuzzleServiceHandler) GetNextPuzzleId ¶
func (UnimplementedPuzzleServiceHandler) GetNextPuzzleId(context.Context, *connect.Request[puzzle_service.NextPuzzleIdRequest]) (*connect.Response[puzzle_service.NextPuzzleIdResponse], error)
func (UnimplementedPuzzleServiceHandler) GetPreviousPuzzleId ¶
func (UnimplementedPuzzleServiceHandler) GetPreviousPuzzleId(context.Context, *connect.Request[puzzle_service.PreviousPuzzleRequest]) (*connect.Response[puzzle_service.PreviousPuzzleResponse], error)
func (UnimplementedPuzzleServiceHandler) GetPuzzle ¶
func (UnimplementedPuzzleServiceHandler) GetPuzzle(context.Context, *connect.Request[puzzle_service.PuzzleRequest]) (*connect.Response[puzzle_service.PuzzleResponse], error)
func (UnimplementedPuzzleServiceHandler) GetPuzzleAnswer ¶
func (UnimplementedPuzzleServiceHandler) GetPuzzleAnswer(context.Context, *connect.Request[puzzle_service.PuzzleRequest]) (*connect.Response[puzzle_service.AnswerResponse], error)
func (UnimplementedPuzzleServiceHandler) GetPuzzleJobLogs ¶
func (UnimplementedPuzzleServiceHandler) GetPuzzleJobLogs(context.Context, *connect.Request[puzzle_service.PuzzleJobLogsRequest]) (*connect.Response[puzzle_service.PuzzleJobLogsResponse], error)
func (UnimplementedPuzzleServiceHandler) GetStartPuzzleId ¶
func (UnimplementedPuzzleServiceHandler) GetStartPuzzleId(context.Context, *connect.Request[puzzle_service.StartPuzzleIdRequest]) (*connect.Response[puzzle_service.StartPuzzleIdResponse], error)
func (UnimplementedPuzzleServiceHandler) SetPuzzleVote ¶
func (UnimplementedPuzzleServiceHandler) SetPuzzleVote(context.Context, *connect.Request[puzzle_service.PuzzleVoteRequest]) (*connect.Response[puzzle_service.PuzzleVoteResponse], error)
func (UnimplementedPuzzleServiceHandler) StartPuzzleGenJob ¶
func (UnimplementedPuzzleServiceHandler) StartPuzzleGenJob(context.Context, *connect.Request[puzzle_service.APIPuzzleGenerationJobRequest]) (*connect.Response[puzzle_service.APIPuzzleGenerationJobResponse], error)
func (UnimplementedPuzzleServiceHandler) SubmitAnswer ¶
func (UnimplementedPuzzleServiceHandler) SubmitAnswer(context.Context, *connect.Request[puzzle_service.SubmissionRequest]) (*connect.Response[puzzle_service.SubmissionResponse], error)