mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
feature/1125 offload sync service worker (#1144)
- **feat: provide access to block time** - **refactor: move block expiry calculation to helper function** - **feat: register decentralized web node HTMX views** - **feat: Reorganize methods in layout.templ file alphabetically** - **feat: add support for layout variants** - **feat: update Allocate RPC to use GET request with path parameters** - **feat: add gRPC Gateway endpoint for Allocate** - **refactor: rename SyncCurrent to Sync** - **feat: improve code organization by making vault assembly private** - **feat: add a new method for syncing DID documents**
This commit is contained in:
@@ -19,11 +19,10 @@ import (
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
Query_Params_FullMethodName = "/vault.v1.Query/Params"
|
||||
Query_Schema_FullMethodName = "/vault.v1.Query/Schema"
|
||||
Query_Allocate_FullMethodName = "/vault.v1.Query/Allocate"
|
||||
Query_SyncInitial_FullMethodName = "/vault.v1.Query/SyncInitial"
|
||||
Query_SyncCurrent_FullMethodName = "/vault.v1.Query/SyncCurrent"
|
||||
Query_Params_FullMethodName = "/vault.v1.Query/Params"
|
||||
Query_Schema_FullMethodName = "/vault.v1.Query/Schema"
|
||||
Query_Allocate_FullMethodName = "/vault.v1.Query/Allocate"
|
||||
Query_Sync_FullMethodName = "/vault.v1.Query/Sync"
|
||||
)
|
||||
|
||||
// QueryClient is the client API for Query service.
|
||||
@@ -40,10 +39,7 @@ type QueryClient interface {
|
||||
Allocate(ctx context.Context, in *AllocateRequest, opts ...grpc.CallOption) (*AllocateResponse, error)
|
||||
// Sync queries the DID document by its id. And returns the required PKL
|
||||
// information
|
||||
SyncInitial(ctx context.Context, in *SyncInitialRequest, opts ...grpc.CallOption) (*SyncInitialResponse, error)
|
||||
// SyncCurrent queries the DID document by its id. And returns the required PKL
|
||||
// information
|
||||
SyncCurrent(ctx context.Context, in *SyncCurrentRequest, opts ...grpc.CallOption) (*SyncCurrentResponse, error)
|
||||
Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error)
|
||||
}
|
||||
|
||||
type queryClient struct {
|
||||
@@ -81,18 +77,9 @@ func (c *queryClient) Allocate(ctx context.Context, in *AllocateRequest, opts ..
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *queryClient) SyncInitial(ctx context.Context, in *SyncInitialRequest, opts ...grpc.CallOption) (*SyncInitialResponse, error) {
|
||||
out := new(SyncInitialResponse)
|
||||
err := c.cc.Invoke(ctx, Query_SyncInitial_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *queryClient) SyncCurrent(ctx context.Context, in *SyncCurrentRequest, opts ...grpc.CallOption) (*SyncCurrentResponse, error) {
|
||||
out := new(SyncCurrentResponse)
|
||||
err := c.cc.Invoke(ctx, Query_SyncCurrent_FullMethodName, in, out, opts...)
|
||||
func (c *queryClient) Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error) {
|
||||
out := new(SyncResponse)
|
||||
err := c.cc.Invoke(ctx, Query_Sync_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -113,10 +100,7 @@ type QueryServer interface {
|
||||
Allocate(context.Context, *AllocateRequest) (*AllocateResponse, error)
|
||||
// Sync queries the DID document by its id. And returns the required PKL
|
||||
// information
|
||||
SyncInitial(context.Context, *SyncInitialRequest) (*SyncInitialResponse, error)
|
||||
// SyncCurrent queries the DID document by its id. And returns the required PKL
|
||||
// information
|
||||
SyncCurrent(context.Context, *SyncCurrentRequest) (*SyncCurrentResponse, error)
|
||||
Sync(context.Context, *SyncRequest) (*SyncResponse, error)
|
||||
mustEmbedUnimplementedQueryServer()
|
||||
}
|
||||
|
||||
@@ -133,11 +117,8 @@ func (UnimplementedQueryServer) Schema(context.Context, *QuerySchemaRequest) (*Q
|
||||
func (UnimplementedQueryServer) Allocate(context.Context, *AllocateRequest) (*AllocateResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Allocate not implemented")
|
||||
}
|
||||
func (UnimplementedQueryServer) SyncInitial(context.Context, *SyncInitialRequest) (*SyncInitialResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SyncInitial not implemented")
|
||||
}
|
||||
func (UnimplementedQueryServer) SyncCurrent(context.Context, *SyncCurrentRequest) (*SyncCurrentResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SyncCurrent not implemented")
|
||||
func (UnimplementedQueryServer) Sync(context.Context, *SyncRequest) (*SyncResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Sync not implemented")
|
||||
}
|
||||
func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
|
||||
|
||||
@@ -206,38 +187,20 @@ func _Query_Allocate_Handler(srv interface{}, ctx context.Context, dec func(inte
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Query_SyncInitial_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SyncInitialRequest)
|
||||
func _Query_Sync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SyncRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(QueryServer).SyncInitial(ctx, in)
|
||||
return srv.(QueryServer).Sync(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Query_SyncInitial_FullMethodName,
|
||||
FullMethod: Query_Sync_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(QueryServer).SyncInitial(ctx, req.(*SyncInitialRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Query_SyncCurrent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SyncCurrentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(QueryServer).SyncCurrent(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Query_SyncCurrent_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(QueryServer).SyncCurrent(ctx, req.(*SyncCurrentRequest))
|
||||
return srv.(QueryServer).Sync(ctx, req.(*SyncRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -262,12 +225,8 @@ var Query_ServiceDesc = grpc.ServiceDesc{
|
||||
Handler: _Query_Allocate_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SyncInitial",
|
||||
Handler: _Query_SyncInitial_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SyncCurrent",
|
||||
Handler: _Query_SyncCurrent_Handler,
|
||||
MethodName: "Sync",
|
||||
Handler: _Query_Sync_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
|
||||
Reference in New Issue
Block a user