Documentation
¶
Index ¶
- Constants
- func NewMercuryServiceHandler(svc MercuryServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type MercuryServiceClient
- type MercuryServiceHandler
- type UnimplementedMercuryServiceHandler
- func (UnimplementedMercuryServiceHandler) CreatePost(context.Context, *connect.Request[api.CreatePostRequest]) (*connect.Response[api.CreatePostResponse], error)
- func (UnimplementedMercuryServiceHandler) GetMedia(context.Context, *connect.Request[api.GetMediaRequest]) (*connect.Response[api.GetMediaResponse], error)
- func (UnimplementedMercuryServiceHandler) GetPersonas(context.Context, *connect.Request[api.GetPersonasRequest]) (*connect.Response[api.GetPersonasResponse], error)
- func (UnimplementedMercuryServiceHandler) GetPosts(context.Context, *connect.Request[api.GetPostsRequest]) (*connect.Response[api.GetPostsResponse], error)
- func (UnimplementedMercuryServiceHandler) SwitchPersona(context.Context, *connect.Request[api.SwitchPersonaRequest]) (*connect.Response[api.SwitchPersonaResponse], error)
Constants ¶
const ( // MercuryServiceCreatePostProcedure is the fully-qualified name of the MercuryService's CreatePost // RPC. MercuryServiceCreatePostProcedure = "/com.mixi.mercury.api.MercuryService/CreatePost" // MercuryServiceGetPostsProcedure is the fully-qualified name of the MercuryService's GetPosts RPC. MercuryServiceGetPostsProcedure = "/com.mixi.mercury.api.MercuryService/GetPosts" // MercuryServiceSwitchPersonaProcedure is the fully-qualified name of the MercuryService's // SwitchPersona RPC. MercuryServiceSwitchPersonaProcedure = "/com.mixi.mercury.api.MercuryService/SwitchPersona" // MercuryServiceGetPersonasProcedure is the fully-qualified name of the MercuryService's // GetPersonas RPC. MercuryServiceGetPersonasProcedure = "/com.mixi.mercury.api.MercuryService/GetPersonas" // MercuryServiceGetMediaProcedure is the fully-qualified name of the MercuryService's GetMedia RPC. MercuryServiceGetMediaProcedure = "/com.mixi.mercury.api.MercuryService/GetMedia" )
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 (
// MercuryServiceName is the fully-qualified name of the MercuryService service.
MercuryServiceName = "com.mixi.mercury.api.MercuryService"
)
Variables ¶
This section is empty.
Functions ¶
func NewMercuryServiceHandler ¶
func NewMercuryServiceHandler(svc MercuryServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewMercuryServiceHandler 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 MercuryServiceClient ¶
type MercuryServiceClient interface { CreatePost(context.Context, *connect.Request[api.CreatePostRequest]) (*connect.Response[api.CreatePostResponse], error) GetPosts(context.Context, *connect.Request[api.GetPostsRequest]) (*connect.Response[api.GetPostsResponse], error) SwitchPersona(context.Context, *connect.Request[api.SwitchPersonaRequest]) (*connect.Response[api.SwitchPersonaResponse], error) GetPersonas(context.Context, *connect.Request[api.GetPersonasRequest]) (*connect.Response[api.GetPersonasResponse], error) GetMedia(context.Context, *connect.Request[api.GetMediaRequest]) (*connect.Response[api.GetMediaResponse], error) }
MercuryServiceClient is a client for the com.mixi.mercury.api.MercuryService service.
func NewMercuryServiceClient ¶
func NewMercuryServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) MercuryServiceClient
NewMercuryServiceClient constructs a client for the com.mixi.mercury.api.MercuryService 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 MercuryServiceHandler ¶
type MercuryServiceHandler interface { CreatePost(context.Context, *connect.Request[api.CreatePostRequest]) (*connect.Response[api.CreatePostResponse], error) GetPosts(context.Context, *connect.Request[api.GetPostsRequest]) (*connect.Response[api.GetPostsResponse], error) SwitchPersona(context.Context, *connect.Request[api.SwitchPersonaRequest]) (*connect.Response[api.SwitchPersonaResponse], error) GetPersonas(context.Context, *connect.Request[api.GetPersonasRequest]) (*connect.Response[api.GetPersonasResponse], error) GetMedia(context.Context, *connect.Request[api.GetMediaRequest]) (*connect.Response[api.GetMediaResponse], error) }
MercuryServiceHandler is an implementation of the com.mixi.mercury.api.MercuryService service.
type UnimplementedMercuryServiceHandler ¶
type UnimplementedMercuryServiceHandler struct{}
UnimplementedMercuryServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedMercuryServiceHandler) CreatePost ¶
func (UnimplementedMercuryServiceHandler) CreatePost(context.Context, *connect.Request[api.CreatePostRequest]) (*connect.Response[api.CreatePostResponse], error)
func (UnimplementedMercuryServiceHandler) GetMedia ¶
func (UnimplementedMercuryServiceHandler) GetMedia(context.Context, *connect.Request[api.GetMediaRequest]) (*connect.Response[api.GetMediaResponse], error)
func (UnimplementedMercuryServiceHandler) GetPersonas ¶
func (UnimplementedMercuryServiceHandler) GetPersonas(context.Context, *connect.Request[api.GetPersonasRequest]) (*connect.Response[api.GetPersonasResponse], error)
func (UnimplementedMercuryServiceHandler) GetPosts ¶
func (UnimplementedMercuryServiceHandler) GetPosts(context.Context, *connect.Request[api.GetPostsRequest]) (*connect.Response[api.GetPostsResponse], error)
func (UnimplementedMercuryServiceHandler) SwitchPersona ¶
func (UnimplementedMercuryServiceHandler) SwitchPersona(context.Context, *connect.Request[api.SwitchPersonaRequest]) (*connect.Response[api.SwitchPersonaResponse], error)