parent
09bb35890b
commit
d9d5deef2c
File diff suppressed because it is too large
Load Diff
@ -1,175 +0,0 @@ |
||||
syntax = "proto3"; |
||||
option go_package = "whiteboxsystems.nl/openkv"; |
||||
|
||||
service OpenKV { |
||||
// Onboarding |
||||
rpc GetMetadata (GetMetadataRequest) returns (GetMetadataResponse) {} |
||||
rpc Register (RegisterRequest) returns (RegisterResponse) {} |
||||
rpc CompleteRegistration (CompleteRegistrationRequest) returns (CompleteRegistrationResponse) {} |
||||
|
||||
// Service config |
||||
rpc ConfigService (ConfigServiceRequest) returns (ConfigServiceResponse) {} |
||||
rpc UpdateSubscriptions (UpdateSubscriptionsRequest) returns (UpdateSubscriptionsResponse) {} |
||||
rpc ListSubscriptions (ListSubscriptionsRequest) returns (ListSubscriptionsResponse) {} |
||||
} |
||||
|
||||
enum AuthMethod { |
||||
mTLS = 0; |
||||
APIToken = 1; |
||||
JWT = 2; |
||||
Custom = 3; |
||||
} |
||||
|
||||
message MTLSConfig { |
||||
string publicKey = 1; |
||||
} |
||||
|
||||
message APITokenConfig { |
||||
string token = 1; |
||||
} |
||||
|
||||
message JWTConfig { |
||||
string publicKey = 1; |
||||
} |
||||
|
||||
message CustomConfig { |
||||
string method = 1; |
||||
map<string, string> params = 2; |
||||
} |
||||
|
||||
message Error { |
||||
int32 code = 1; |
||||
string message = 2; |
||||
} |
||||
|
||||
enum SubscriptionPolicy { |
||||
subnone = 0; |
||||
optin = 1; |
||||
optout = 2; |
||||
} |
||||
|
||||
enum ConsentPolicy { |
||||
consentnone = 0; |
||||
explicit = 1; |
||||
presumed = 2; |
||||
} |
||||
|
||||
message ProtocolDefinition { |
||||
string protocol = 1; |
||||
repeated AuthMethod authMethods = 2; |
||||
} |
||||
|
||||
message ServiceDefinition { |
||||
string id = 1; |
||||
string name = 2; |
||||
string description = 3; |
||||
SubscriptionPolicy subscriptionPolicy = 4; |
||||
ConsentPolicy consentPolicy = 5; |
||||
repeated ProtocolDefinition fetchProtocols = 6; |
||||
repeated ProtocolDefinition pushProtocols = 7; |
||||
} |
||||
|
||||
message ServiceConfig { |
||||
string protocol = 1; |
||||
map<string,string> config = 2; |
||||
AuthConfig auth = 3; |
||||
} |
||||
|
||||
message GetMetadataRequest {} |
||||
|
||||
message GetMetadataResponse { |
||||
string supplier = 1; |
||||
string system = 2; |
||||
repeated ServiceDefinition services = 3; |
||||
bool success = 4; |
||||
Error error = 5; |
||||
} |
||||
|
||||
message AuthConfig { |
||||
AuthMethod method = 1; |
||||
oneof config { |
||||
MTLSConfig mtlsConfig = 2; |
||||
APITokenConfig apiTokenConfig = 3; |
||||
JWTConfig jwtConfig = 4; |
||||
} |
||||
} |
||||
|
||||
message RegisterRequest { |
||||
string organisationId = 1; |
||||
string organisationIdSystem = 2; // Type bijv AGB of BIG registratie |
||||
string organisationDisplayName = 3; |
||||
string organisationFormalName = 4; |
||||
AuthConfig auth = 5; |
||||
} |
||||
|
||||
message RegisterResponse { |
||||
string reference = 1; |
||||
bool success = 2; |
||||
Error error = 3; |
||||
} |
||||
|
||||
message CompleteRegistrationRequest { |
||||
string reference = 1; |
||||
string registrationToken = 2; |
||||
} |
||||
|
||||
message CompleteRegistrationResponse { |
||||
bool success = 1; |
||||
Error error = 2; |
||||
} |
||||
|
||||
message ConfigServiceRequest { |
||||
string service = 1; |
||||
bool enabled = 2; |
||||
ServiceConfig fetch = 3; |
||||
ServiceConfig push = 4; |
||||
} |
||||
|
||||
message ConfigServiceResponse { |
||||
string service = 1; |
||||
bool enabled = 2; |
||||
ServiceConfig fetch = 3; |
||||
ServiceConfig push = 4; |
||||
bool success = 5; |
||||
Error error = 6; |
||||
} |
||||
|
||||
message PatientMeta { |
||||
string externalId = 1; |
||||
string externalIdSystem = 2; |
||||
string name = 3; |
||||
string birthdate = 4; |
||||
map<string, string> custom = 5; |
||||
} |
||||
|
||||
message SubscriptionData { |
||||
PatientMeta subject = 1; |
||||
bool subscribe = 2; |
||||
map<string, string> protocolMeta = 3; |
||||
} |
||||
|
||||
message UpdateSubscriptionsRequest { |
||||
string serviceId = 1; |
||||
repeated SubscriptionData subscriptionData = 2; |
||||
bool atomicUpdate = 3; |
||||
} |
||||
|
||||
message SubscriptionError { |
||||
int32 index = 1; |
||||
Error error = 2; |
||||
} |
||||
|
||||
message UpdateSubscriptionsResponse { |
||||
bool success = 1; |
||||
repeated SubscriptionError errors = 2; |
||||
} |
||||
|
||||
message ListSubscriptionsRequest { |
||||
string serviceId = 1; |
||||
} |
||||
|
||||
message ListSubscriptionsResponse { |
||||
bool success = 1; |
||||
repeated SubscriptionData subscriptionData = 2; |
||||
Error error = 3; |
||||
} |
@ -1,285 +0,0 @@ |
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
|
||||
package openkv |
||||
|
||||
import ( |
||||
context "context" |
||||
grpc "google.golang.org/grpc" |
||||
codes "google.golang.org/grpc/codes" |
||||
status "google.golang.org/grpc/status" |
||||
) |
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7 |
||||
|
||||
// OpenKVClient is the client API for OpenKV service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type OpenKVClient interface { |
||||
// Onboarding
|
||||
GetMetadata(ctx context.Context, in *GetMetadataRequest, opts ...grpc.CallOption) (*GetMetadataResponse, error) |
||||
Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error) |
||||
CompleteRegistration(ctx context.Context, in *CompleteRegistrationRequest, opts ...grpc.CallOption) (*CompleteRegistrationResponse, error) |
||||
// Service config
|
||||
ConfigService(ctx context.Context, in *ConfigServiceRequest, opts ...grpc.CallOption) (*ConfigServiceResponse, error) |
||||
UpdateSubscriptions(ctx context.Context, in *UpdateSubscriptionsRequest, opts ...grpc.CallOption) (*UpdateSubscriptionsResponse, error) |
||||
ListSubscriptions(ctx context.Context, in *ListSubscriptionsRequest, opts ...grpc.CallOption) (*ListSubscriptionsResponse, error) |
||||
} |
||||
|
||||
type openKVClient struct { |
||||
cc grpc.ClientConnInterface |
||||
} |
||||
|
||||
func NewOpenKVClient(cc grpc.ClientConnInterface) OpenKVClient { |
||||
return &openKVClient{cc} |
||||
} |
||||
|
||||
func (c *openKVClient) GetMetadata(ctx context.Context, in *GetMetadataRequest, opts ...grpc.CallOption) (*GetMetadataResponse, error) { |
||||
out := new(GetMetadataResponse) |
||||
err := c.cc.Invoke(ctx, "/OpenKV/GetMetadata", in, out, opts...) |
||||
if err != nil { |
||||
return nil, err |
||||
} |
||||
return out, nil |
||||
} |
||||
|
||||
func (c *openKVClient) Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error) { |
||||
out := new(RegisterResponse) |
||||
err := c.cc.Invoke(ctx, "/OpenKV/Register", in, out, opts...) |
||||
if err != nil { |
||||
return nil, err |
||||
} |
||||
return out, nil |
||||
} |
||||
|
||||
func (c *openKVClient) CompleteRegistration(ctx context.Context, in *CompleteRegistrationRequest, opts ...grpc.CallOption) (*CompleteRegistrationResponse, error) { |
||||
out := new(CompleteRegistrationResponse) |
||||
err := c.cc.Invoke(ctx, "/OpenKV/CompleteRegistration", in, out, opts...) |
||||
if err != nil { |
||||
return nil, err |
||||
} |
||||
return out, nil |
||||
} |
||||
|
||||
func (c *openKVClient) ConfigService(ctx context.Context, in *ConfigServiceRequest, opts ...grpc.CallOption) (*ConfigServiceResponse, error) { |
||||
out := new(ConfigServiceResponse) |
||||
err := c.cc.Invoke(ctx, "/OpenKV/ConfigService", in, out, opts...) |
||||
if err != nil { |
||||
return nil, err |
||||
} |
||||
return out, nil |
||||
} |
||||
|
||||
func (c *openKVClient) UpdateSubscriptions(ctx context.Context, in *UpdateSubscriptionsRequest, opts ...grpc.CallOption) (*UpdateSubscriptionsResponse, error) { |
||||
out := new(UpdateSubscriptionsResponse) |
||||
err := c.cc.Invoke(ctx, "/OpenKV/UpdateSubscriptions", in, out, opts...) |
||||
if err != nil { |
||||
return nil, err |
||||
} |
||||
return out, nil |
||||
} |
||||
|
||||
func (c *openKVClient) ListSubscriptions(ctx context.Context, in *ListSubscriptionsRequest, opts ...grpc.CallOption) (*ListSubscriptionsResponse, error) { |
||||
out := new(ListSubscriptionsResponse) |
||||
err := c.cc.Invoke(ctx, "/OpenKV/ListSubscriptions", in, out, opts...) |
||||
if err != nil { |
||||
return nil, err |
||||
} |
||||
return out, nil |
||||
} |
||||
|
||||
// OpenKVServer is the server API for OpenKV service.
|
||||
// All implementations must embed UnimplementedOpenKVServer
|
||||
// for forward compatibility
|
||||
type OpenKVServer interface { |
||||
// Onboarding
|
||||
GetMetadata(context.Context, *GetMetadataRequest) (*GetMetadataResponse, error) |
||||
Register(context.Context, *RegisterRequest) (*RegisterResponse, error) |
||||
CompleteRegistration(context.Context, *CompleteRegistrationRequest) (*CompleteRegistrationResponse, error) |
||||
// Service config
|
||||
ConfigService(context.Context, *ConfigServiceRequest) (*ConfigServiceResponse, error) |
||||
UpdateSubscriptions(context.Context, *UpdateSubscriptionsRequest) (*UpdateSubscriptionsResponse, error) |
||||
ListSubscriptions(context.Context, *ListSubscriptionsRequest) (*ListSubscriptionsResponse, error) |
||||
mustEmbedUnimplementedOpenKVServer() |
||||
} |
||||
|
||||
// UnimplementedOpenKVServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedOpenKVServer struct { |
||||
} |
||||
|
||||
func (UnimplementedOpenKVServer) GetMetadata(context.Context, *GetMetadataRequest) (*GetMetadataResponse, error) { |
||||
return nil, status.Errorf(codes.Unimplemented, "method GetMetadata not implemented") |
||||
} |
||||
func (UnimplementedOpenKVServer) Register(context.Context, *RegisterRequest) (*RegisterResponse, error) { |
||||
return nil, status.Errorf(codes.Unimplemented, "method Register not implemented") |
||||
} |
||||
func (UnimplementedOpenKVServer) CompleteRegistration(context.Context, *CompleteRegistrationRequest) (*CompleteRegistrationResponse, error) { |
||||
return nil, status.Errorf(codes.Unimplemented, "method CompleteRegistration not implemented") |
||||
} |
||||
func (UnimplementedOpenKVServer) ConfigService(context.Context, *ConfigServiceRequest) (*ConfigServiceResponse, error) { |
||||
return nil, status.Errorf(codes.Unimplemented, "method ConfigService not implemented") |
||||
} |
||||
func (UnimplementedOpenKVServer) UpdateSubscriptions(context.Context, *UpdateSubscriptionsRequest) (*UpdateSubscriptionsResponse, error) { |
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateSubscriptions not implemented") |
||||
} |
||||
func (UnimplementedOpenKVServer) ListSubscriptions(context.Context, *ListSubscriptionsRequest) (*ListSubscriptionsResponse, error) { |
||||
return nil, status.Errorf(codes.Unimplemented, "method ListSubscriptions not implemented") |
||||
} |
||||
func (UnimplementedOpenKVServer) mustEmbedUnimplementedOpenKVServer() {} |
||||
|
||||
// UnsafeOpenKVServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to OpenKVServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeOpenKVServer interface { |
||||
mustEmbedUnimplementedOpenKVServer() |
||||
} |
||||
|
||||
func RegisterOpenKVServer(s grpc.ServiceRegistrar, srv OpenKVServer) { |
||||
s.RegisterService(&OpenKV_ServiceDesc, srv) |
||||
} |
||||
|
||||
func _OpenKV_GetMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
||||
in := new(GetMetadataRequest) |
||||
if err := dec(in); err != nil { |
||||
return nil, err |
||||
} |
||||
if interceptor == nil { |
||||
return srv.(OpenKVServer).GetMetadata(ctx, in) |
||||
} |
||||
info := &grpc.UnaryServerInfo{ |
||||
Server: srv, |
||||
FullMethod: "/OpenKV/GetMetadata", |
||||
} |
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
||||
return srv.(OpenKVServer).GetMetadata(ctx, req.(*GetMetadataRequest)) |
||||
} |
||||
return interceptor(ctx, in, info, handler) |
||||
} |
||||
|
||||
func _OpenKV_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
||||
in := new(RegisterRequest) |
||||
if err := dec(in); err != nil { |
||||
return nil, err |
||||
} |
||||
if interceptor == nil { |
||||
return srv.(OpenKVServer).Register(ctx, in) |
||||
} |
||||
info := &grpc.UnaryServerInfo{ |
||||
Server: srv, |
||||
FullMethod: "/OpenKV/Register", |
||||
} |
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
||||
return srv.(OpenKVServer).Register(ctx, req.(*RegisterRequest)) |
||||
} |
||||
return interceptor(ctx, in, info, handler) |
||||
} |
||||
|
||||
func _OpenKV_CompleteRegistration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
||||
in := new(CompleteRegistrationRequest) |
||||
if err := dec(in); err != nil { |
||||
return nil, err |
||||
} |
||||
if interceptor == nil { |
||||
return srv.(OpenKVServer).CompleteRegistration(ctx, in) |
||||
} |
||||
info := &grpc.UnaryServerInfo{ |
||||
Server: srv, |
||||
FullMethod: "/OpenKV/CompleteRegistration", |
||||
} |
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
||||
return srv.(OpenKVServer).CompleteRegistration(ctx, req.(*CompleteRegistrationRequest)) |
||||
} |
||||
return interceptor(ctx, in, info, handler) |
||||
} |
||||
|
||||
func _OpenKV_ConfigService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
||||
in := new(ConfigServiceRequest) |
||||
if err := dec(in); err != nil { |
||||
return nil, err |
||||
} |
||||
if interceptor == nil { |
||||
return srv.(OpenKVServer).ConfigService(ctx, in) |
||||
} |
||||
info := &grpc.UnaryServerInfo{ |
||||
Server: srv, |
||||
FullMethod: "/OpenKV/ConfigService", |
||||
} |
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
||||
return srv.(OpenKVServer).ConfigService(ctx, req.(*ConfigServiceRequest)) |
||||
} |
||||
return interceptor(ctx, in, info, handler) |
||||
} |
||||
|
||||
func _OpenKV_UpdateSubscriptions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
||||
in := new(UpdateSubscriptionsRequest) |
||||
if err := dec(in); err != nil { |
||||
return nil, err |
||||
} |
||||
if interceptor == nil { |
||||
return srv.(OpenKVServer).UpdateSubscriptions(ctx, in) |
||||
} |
||||
info := &grpc.UnaryServerInfo{ |
||||
Server: srv, |
||||
FullMethod: "/OpenKV/UpdateSubscriptions", |
||||
} |
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
||||
return srv.(OpenKVServer).UpdateSubscriptions(ctx, req.(*UpdateSubscriptionsRequest)) |
||||
} |
||||
return interceptor(ctx, in, info, handler) |
||||
} |
||||
|
||||
func _OpenKV_ListSubscriptions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
||||
in := new(ListSubscriptionsRequest) |
||||
if err := dec(in); err != nil { |
||||
return nil, err |
||||
} |
||||
if interceptor == nil { |
||||
return srv.(OpenKVServer).ListSubscriptions(ctx, in) |
||||
} |
||||
info := &grpc.UnaryServerInfo{ |
||||
Server: srv, |
||||
FullMethod: "/OpenKV/ListSubscriptions", |
||||
} |
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
||||
return srv.(OpenKVServer).ListSubscriptions(ctx, req.(*ListSubscriptionsRequest)) |
||||
} |
||||
return interceptor(ctx, in, info, handler) |
||||
} |
||||
|
||||
// OpenKV_ServiceDesc is the grpc.ServiceDesc for OpenKV service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var OpenKV_ServiceDesc = grpc.ServiceDesc{ |
||||
ServiceName: "OpenKV", |
||||
HandlerType: (*OpenKVServer)(nil), |
||||
Methods: []grpc.MethodDesc{ |
||||
{ |
||||
MethodName: "GetMetadata", |
||||
Handler: _OpenKV_GetMetadata_Handler, |
||||
}, |
||||
{ |
||||
MethodName: "Register", |
||||
Handler: _OpenKV_Register_Handler, |
||||
}, |
||||
{ |
||||
MethodName: "CompleteRegistration", |
||||
Handler: _OpenKV_CompleteRegistration_Handler, |
||||
}, |
||||
{ |
||||
MethodName: "ConfigService", |
||||
Handler: _OpenKV_ConfigService_Handler, |
||||
}, |
||||
{ |
||||
MethodName: "UpdateSubscriptions", |
||||
Handler: _OpenKV_UpdateSubscriptions_Handler, |
||||
}, |
||||
{ |
||||
MethodName: "ListSubscriptions", |
||||
Handler: _OpenKV_ListSubscriptions_Handler, |
||||
}, |
||||
}, |
||||
Streams: []grpc.StreamDesc{}, |
||||
Metadata: "apispec.proto", |
||||
} |
@ -1,7 +0,0 @@ |
||||
package openkv |
||||
|
||||
const ( |
||||
ErrUnknown = -9999 |
||||
ErrCodeAlreadySubscribed = iota + 1 |
||||
ErrServiceException |
||||
) |
Loading…
Reference in new issue