gitforgefs/main.go

42 lines
1.0 KiB
Go
Raw Normal View History

2020-12-26 19:36:09 +00:00
package main
2020-12-27 03:30:19 +00:00
import (
"flag"
"fmt"
"os"
"github.com/badjware/gitlabfs/fs"
2020-12-27 03:30:19 +00:00
"github.com/badjware/gitlabfs/gitlab"
)
2020-12-26 19:36:09 +00:00
func main() {
2020-12-27 03:30:19 +00:00
gitlabURL := flag.String("gitlab-url", "https://gitlab.com", "the gitlab url")
gitlabToken := flag.String("gitlab-token", "", "the gitlab authentication token")
gitlabRootGroupID := flag.Int("gitlab-group-id", 9970, "the group id of the groups at the root of the filesystem")
// gitlabNamespace := flag.String()
flag.Parse()
if flag.NArg() != 1 {
fmt.Printf("usage: %s MOUNTPOINT\n", os.Args[0])
os.Exit(2)
2020-12-27 03:30:19 +00:00
}
mountpoint := flag.Arg(0)
2020-12-27 03:30:19 +00:00
gitlabClient, _ := gitlab.NewClient(*gitlabURL, *gitlabToken)
2020-12-27 03:30:19 +00:00
fs.Start(gitlabClient, mountpoint, *gitlabRootGroupID)
// content, err := gitlabClient.FetchGroupContent(&rootGroup)
// if err != nil {
// fmt.Println(err)
// }
// fmt.Println("Projects")
// for _, r := range content.Repositories {
// fmt.Println(r.Name, r.Path, r.CloneURL)
// }
// fmt.Println("Groups")
// for _, g := range content.Groups {
// fmt.Println(g.Name, g.Path)
// }
2020-12-26 19:36:09 +00:00
}