Documentation
¶
Index ¶
- Constants
- func NewKeyValueServiceHandler(svc KeyValueServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type KeyValueServiceClient
- type KeyValueServiceHandler
- type UnimplementedKeyValueServiceHandler
- func (UnimplementedKeyValueServiceHandler) Delete(context.Context, *connect.Request[v1.DeleteRequest]) (*connect.Response[v1.DeleteResponse], error)
- func (UnimplementedKeyValueServiceHandler) Get(context.Context, *connect.Request[v1.GetRequest]) (*connect.Response[v1.GetResponse], error)
- func (UnimplementedKeyValueServiceHandler) List(context.Context, *connect.Request[v1.ListRequest]) (*connect.Response[v1.ListResponse], error)
- func (UnimplementedKeyValueServiceHandler) Set(context.Context, *connect.Request[v1.SetRequest]) (*connect.Response[v1.SetResponse], error)
Constants ¶
const ( // KeyValueServiceSetProcedure is the fully-qualified name of the KeyValueService's Set RPC. KeyValueServiceSetProcedure = "/core.registry.key_value.v1.KeyValueService/Set" // KeyValueServiceGetProcedure is the fully-qualified name of the KeyValueService's Get RPC. KeyValueServiceGetProcedure = "/core.registry.key_value.v1.KeyValueService/Get" // KeyValueServiceDeleteProcedure is the fully-qualified name of the KeyValueService's Delete RPC. KeyValueServiceDeleteProcedure = "/core.registry.key_value.v1.KeyValueService/Delete" // KeyValueServiceListProcedure is the fully-qualified name of the KeyValueService's List RPC. KeyValueServiceListProcedure = "/core.registry.key_value.v1.KeyValueService/List" )
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 (
// KeyValueServiceName is the fully-qualified name of the KeyValueService service.
KeyValueServiceName = "core.registry.key_value.v1.KeyValueService"
)
Variables ¶
This section is empty.
Functions ¶
func NewKeyValueServiceHandler ¶
func NewKeyValueServiceHandler(svc KeyValueServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewKeyValueServiceHandler 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 KeyValueServiceClient ¶
type KeyValueServiceClient interface { // SET - A key/val pair Set(context.Context, *connect.Request[v1.SetRequest]) (*connect.Response[v1.SetResponse], error) // GET - A key/val pair Get(context.Context, *connect.Request[v1.GetRequest]) (*connect.Response[v1.GetResponse], error) // DELETE - remove a key, and it's associated value Delete(context.Context, *connect.Request[v1.DeleteRequest]) (*connect.Response[v1.DeleteResponse], error) // List accepts a type to search the key_value store for all keys // matching that type, if any are found they will all be returned // as a map. List(context.Context, *connect.Request[v1.ListRequest]) (*connect.Response[v1.ListResponse], error) }
KeyValueServiceClient is a client for the core.registry.key_value.v1.KeyValueService service.
func NewKeyValueServiceClient ¶
func NewKeyValueServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) KeyValueServiceClient
NewKeyValueServiceClient constructs a client for the core.registry.key_value.v1.KeyValueService 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 KeyValueServiceHandler ¶
type KeyValueServiceHandler interface { // SET - A key/val pair Set(context.Context, *connect.Request[v1.SetRequest]) (*connect.Response[v1.SetResponse], error) // GET - A key/val pair Get(context.Context, *connect.Request[v1.GetRequest]) (*connect.Response[v1.GetResponse], error) // DELETE - remove a key, and it's associated value Delete(context.Context, *connect.Request[v1.DeleteRequest]) (*connect.Response[v1.DeleteResponse], error) // List accepts a type to search the key_value store for all keys // matching that type, if any are found they will all be returned // as a map. List(context.Context, *connect.Request[v1.ListRequest]) (*connect.Response[v1.ListResponse], error) }
KeyValueServiceHandler is an implementation of the core.registry.key_value.v1.KeyValueService service.
type UnimplementedKeyValueServiceHandler ¶
type UnimplementedKeyValueServiceHandler struct{}
UnimplementedKeyValueServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedKeyValueServiceHandler) Delete ¶
func (UnimplementedKeyValueServiceHandler) Delete(context.Context, *connect.Request[v1.DeleteRequest]) (*connect.Response[v1.DeleteResponse], error)
func (UnimplementedKeyValueServiceHandler) Get ¶
func (UnimplementedKeyValueServiceHandler) Get(context.Context, *connect.Request[v1.GetRequest]) (*connect.Response[v1.GetResponse], error)
func (UnimplementedKeyValueServiceHandler) List ¶
func (UnimplementedKeyValueServiceHandler) List(context.Context, *connect.Request[v1.ListRequest]) (*connect.Response[v1.ListResponse], error)
func (UnimplementedKeyValueServiceHandler) Set ¶
func (UnimplementedKeyValueServiceHandler) Set(context.Context, *connect.Request[v1.SetRequest]) (*connect.Response[v1.SetResponse], error)