build out cli and add size and gather functionality

This commit is contained in:
2024-06-05 00:03:05 -06:00
parent 6507518cd7
commit b3bbd2e5d1
11 changed files with 254 additions and 48 deletions

View File

@ -1,31 +1,20 @@
package main
import (
"context"
"fmt"
"github.com/urfave/cli/v2"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"os"
"time"
"github.com/urfave/cli/v2"
)
func main() {
commands := []*cli.Command{
&cli.Command{
Name: "start",
Aliases: []string{"s"},
Usage: "Start the application service",
Action: func(c *cli.Context) error {
//d := daemon.NewDaemon()
//d.Start()
return nil
},
},
gather(),
plan(),
}
app := &cli.App{
Name: "ForeverFiles",
Name: "forever",
Usage: "Create backups designed to last forever",
Version: "v1.0.0",
Description: "ForeverFiles is a system for storing files forever.",
@ -37,7 +26,7 @@ func main() {
Email: "mason@masonitestudios.com",
},
},
Copyright: fmt.Sprintf("%v Masonite Studios LLC", time.Now().Year()),
Copyright: "2024 Masonite Studios LLC",
UseShortOptionHandling: true,
}
err := app.Run(os.Args)
@ -46,16 +35,3 @@ func main() {
return
}
}
func getConn(dialAddr string) (*grpc.ClientConn, error) {
conn, err := grpc.DialContext(
context.Background(),
dialAddr,
//grpc.WithBlock(),
grpc.WithTransportCredentials(insecure.NewCredentials()),
)
if err != nil {
return &grpc.ClientConn{}, fmt.Errorf("failed to dial server: %w", err)
}
return conn, nil
}