formconnect

package
v0.0.0-...-2f38b72 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FormServiceGetByIdProcedure is the fully-qualified name of the FormService's GetById RPC.
	FormServiceGetByIdProcedure = "/form.v1.FormService/GetById"
	// FormServiceCreateProcedure is the fully-qualified name of the FormService's Create RPC.
	FormServiceCreateProcedure = "/form.v1.FormService/Create"
	// FormServiceListProcedure is the fully-qualified name of the FormService's List RPC.
	FormServiceListProcedure = "/form.v1.FormService/List"
	// FormServiceUpdateProcedure is the fully-qualified name of the FormService's Update RPC.
	FormServiceUpdateProcedure = "/form.v1.FormService/Update"
	// FormServiceGetQuestionsProcedure is the fully-qualified name of the FormService's GetQuestions
	// RPC.
	FormServiceGetQuestionsProcedure = "/form.v1.FormService/GetQuestions"
)

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 (
	// FormServiceName is the fully-qualified name of the FormService service.
	FormServiceName = "form.v1.FormService"
)

Variables

This section is empty.

Functions

func NewFormServiceHandler

func NewFormServiceHandler(svc FormServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewFormServiceHandler 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 FormServiceClient

type FormServiceClient interface {
	GetById(context.Context, *connect.Request[v1.GetByIdRequest]) (*connect.Response[v1.GetByIdResponse], error)
	Create(context.Context, *connect.Request[v1.CreateRequest]) (*connect.Response[v1.CreateResponse], error)
	List(context.Context, *connect.Request[v1.ListRequest]) (*connect.Response[v1.ListResponse], error)
	// Updating the form will create a new version of the form with its contents
	// being the provided form
	Update(context.Context, *connect.Request[v1.UpdateRequest]) (*connect.Response[v1.UpdateResponse], error)
	GetQuestions(context.Context, *connect.Request[v1.GetQuestionsRequest]) (*connect.Response[v1.GetQuestionsResponse], error)
}

FormServiceClient is a client for the form.v1.FormService service.

func NewFormServiceClient

func NewFormServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) FormServiceClient

NewFormServiceClient constructs a client for the form.v1.FormService 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 FormServiceHandler

type FormServiceHandler interface {
	GetById(context.Context, *connect.Request[v1.GetByIdRequest]) (*connect.Response[v1.GetByIdResponse], error)
	Create(context.Context, *connect.Request[v1.CreateRequest]) (*connect.Response[v1.CreateResponse], error)
	List(context.Context, *connect.Request[v1.ListRequest]) (*connect.Response[v1.ListResponse], error)
	// Updating the form will create a new version of the form with its contents
	// being the provided form
	Update(context.Context, *connect.Request[v1.UpdateRequest]) (*connect.Response[v1.UpdateResponse], error)
	GetQuestions(context.Context, *connect.Request[v1.GetQuestionsRequest]) (*connect.Response[v1.GetQuestionsResponse], error)
}

FormServiceHandler is an implementation of the form.v1.FormService service.

type UnimplementedFormServiceHandler

type UnimplementedFormServiceHandler struct{}

UnimplementedFormServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedFormServiceHandler) List

Jump to

Keyboard shortcuts

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