Skip to content

Commit 3db9aa4

Browse files
committed
first commit!
0 parents  commit 3db9aa4

File tree

6 files changed

+350
-0
lines changed

6 files changed

+350
-0
lines changed

Diff for: LICENSE

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2023 Chihiro Hasegawa
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Diff for: cmd/root.go

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
Copyright © 2023 Chihiro Hasegawa <[email protected]>
3+
*/
4+
package cmd
5+
6+
import (
7+
"context"
8+
"fmt"
9+
"log"
10+
"os"
11+
12+
"github.com/owlinux1000/gcstree/internal"
13+
"github.com/spf13/cobra"
14+
)
15+
16+
var rootCmd = &cobra.Command{
17+
Use: "gcstree <bucket>",
18+
Short: "A tree command for Google Cloud Storage",
19+
Long: ``,
20+
Args: cobra.MinimumNArgs(1),
21+
Run: func(cmd *cobra.Command, args []string) {
22+
bucket := args[0]
23+
var ctx context.Context = context.Background()
24+
gcsTree, err := internal.NewGCSTree(ctx, bucket)
25+
if err != nil {
26+
log.Fatal(err)
27+
}
28+
result, err := gcsTree.Tree()
29+
if err != nil {
30+
log.Fatal(err)
31+
}
32+
fmt.Println(result)
33+
},
34+
}
35+
36+
func Execute() {
37+
err := rootCmd.Execute()
38+
if err != nil {
39+
os.Exit(1)
40+
}
41+
}

Diff for: go.mod

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
module github.com/owlinux1000/gcstree
2+
3+
go 1.21.1
4+
5+
require (
6+
cloud.google.com/go/storage v1.33.0
7+
github.com/spf13/cobra v1.7.0
8+
google.golang.org/api v0.143.0
9+
)
10+
11+
require (
12+
cloud.google.com/go v0.110.7 // indirect
13+
cloud.google.com/go/compute v1.23.0 // indirect
14+
cloud.google.com/go/compute/metadata v0.2.3 // indirect
15+
cloud.google.com/go/iam v1.1.1 // indirect
16+
github.com/ddddddO/gtree v1.9.11 // indirect
17+
github.com/fatih/color v1.15.0 // indirect
18+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
19+
github.com/golang/protobuf v1.5.3 // indirect
20+
github.com/google/go-cmp v0.5.9 // indirect
21+
github.com/google/s2a-go v0.1.7 // indirect
22+
github.com/google/uuid v1.3.1 // indirect
23+
github.com/googleapis/enterprise-certificate-proxy v0.3.1 // indirect
24+
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
25+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
26+
github.com/mattn/go-colorable v0.1.13 // indirect
27+
github.com/mattn/go-isatty v0.0.17 // indirect
28+
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
29+
github.com/spf13/pflag v1.0.5 // indirect
30+
go.opencensus.io v0.24.0 // indirect
31+
golang.org/x/crypto v0.13.0 // indirect
32+
golang.org/x/net v0.15.0 // indirect
33+
golang.org/x/oauth2 v0.12.0 // indirect
34+
golang.org/x/sync v0.3.0 // indirect
35+
golang.org/x/sys v0.12.0 // indirect
36+
golang.org/x/text v0.13.0 // indirect
37+
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
38+
google.golang.org/appengine v1.6.7 // indirect
39+
google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb // indirect
40+
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb // indirect
41+
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 // indirect
42+
google.golang.org/grpc v1.57.0 // indirect
43+
google.golang.org/protobuf v1.31.0 // indirect
44+
gopkg.in/yaml.v3 v3.0.1 // indirect
45+
)

0 commit comments

Comments
 (0)