Skip to content

Commit e091e67

Browse files
committed
move web project
1 parent 6352996 commit e091e67

24 files changed

+20
-4951
lines changed

pkg/fs/ls.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ import (
1313
// DirEntry contains info about a file.
1414
type DirEntry struct {
1515
// Cid is the id of the entry.
16-
Cid cid.Cid
16+
Cid cid.Cid `json:"cid"`
1717
// Name is the name of the file.
18-
Name string
18+
Name string `json:"name"`
1919
// IsDir indicates if the file is a directory.
20-
IsDir bool
20+
IsDir bool `json:"is_dir"`
2121
// Size is the size in bytes of the file.
22-
Size uint64
22+
Size uint64 `json:"size"`
2323
}
2424

2525
// ByTypeAndName is used to sort dir entries.

pkg/rpc/repo/create.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package repo
33
import (
44
"context"
55
"errors"
6+
"path"
67

78
"github.com/multiverse-vcs/go-multiverse/pkg/object"
89
"github.com/multiverse-vcs/go-multiverse/pkg/p2p"
@@ -15,7 +16,10 @@ type CreateArgs struct {
1516
}
1617

1718
// CreateReply contains the reply
18-
type CreateReply struct{}
19+
type CreateReply struct{
20+
// Remote is the repository path
21+
Remote string `json:"remote"`
22+
}
1923

2024
// Create creates a new repository.
2125
func (s *Service) Create(args *CreateArgs, reply *CreateReply) error {
@@ -51,5 +55,6 @@ func (s *Service) Create(args *CreateArgs, reply *CreateReply) error {
5155
return err
5256
}
5357

58+
reply.Remote = path.Join(s.Peer.Host.ID().Pretty(), args.Name)
5459
return s.Namesys.Publish(ctx, key, authorID)
5560
}

pkg/rpc/repo/list.go

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
package repo
22

33
import (
4-
cid "github.com/ipfs/go-cid"
4+
"sort"
55
)
66

77
// ListArgs contains the args.
88
type ListArgs struct{}
99

1010
// ListReply contains the reply
1111
type ListReply struct {
12-
// Repositories is a map of repositories.
13-
Repositories map[string]cid.Cid `json:"repositories"`
12+
// Repositories is a list of repositories.
13+
Repositories []string `json:"repositories"`
1414
}
1515

1616
// List returns a list of repositories.
1717
func (s *Service) List(args *ListArgs, reply *ListReply) error {
18-
reply.Repositories = s.Config.Author.Repositories
18+
var names []string
19+
for name := range s.Config.Author.Repositories {
20+
names = append(names, name)
21+
}
22+
sort.Strings(names)
23+
24+
reply.Repositories = names
1925
return nil
2026
}

web/.gitignore

-4
This file was deleted.

web/forge.config.js

-23
This file was deleted.

web/package.json

-38
This file was deleted.

web/postcss.config.js

-6
This file was deleted.

web/public/feather-sprite.svg

-1
This file was deleted.

web/public/index.html

-12
This file was deleted.

web/snowpack.config.js

-28
This file was deleted.

web/src/App.svelte

-24
This file was deleted.

web/src/components/Icon.svelte

-19
This file was deleted.

web/src/components/NavBar.svelte

-85
This file was deleted.

web/src/components/Profile.svelte

-19
This file was deleted.

web/src/components/SideBar.svelte

-45
This file was deleted.

0 commit comments

Comments
 (0)