mirror of
https://github.com/mitchell/selfpass.git
synced 2025-12-14 21:27:22 +00:00
Modify sp and services to use the protobuf module
This commit is contained in:
parent
66ec035ee0
commit
4fc74b0994
23 changed files with 59 additions and 1025 deletions
|
|
@ -30,7 +30,7 @@ func MakeGetEndpoint(svc types.Service) endpoint.Endpoint {
|
|||
|
||||
func MakeGetAllMetadataEndpoint(svc types.Service) endpoint.Endpoint {
|
||||
return func(ctx context.Context, request interface{}) (response interface{}, err error) {
|
||||
r := request.(GetAllMetadataRequest)
|
||||
r := request.(SourceHostRequest)
|
||||
|
||||
mdch, errch := svc.GetAllMetadata(ctx, r.SourceHost)
|
||||
|
||||
|
|
@ -48,13 +48,6 @@ func MakeUpdateEndpoint(svc types.Service) endpoint.Endpoint {
|
|||
}
|
||||
}
|
||||
|
||||
func MakeDumpEndpoint(svc types.Service) endpoint.Endpoint {
|
||||
return func(ctx context.Context, request interface{}) (response interface{}, err error) {
|
||||
contents, err := svc.DumpDB(ctx)
|
||||
return DumpResponse{Contents: contents}, err
|
||||
}
|
||||
}
|
||||
|
||||
type DumpResponse struct {
|
||||
Contents []byte
|
||||
}
|
||||
|
|
@ -63,7 +56,7 @@ type IDRequest struct {
|
|||
ID string
|
||||
}
|
||||
|
||||
type GetAllMetadataRequest struct {
|
||||
type SourceHostRequest struct {
|
||||
SourceHost string
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue