Skip to content

Commit 98257c9

Browse files
committed
refs #3 マテビュー定義用のcustom_optionを作成した
1 parent aba4918 commit 98257c9

File tree

8 files changed

+368
-13
lines changed

8 files changed

+368
-13
lines changed

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ test:
1111
format:
1212
go fmt ./...
1313
golangci-lint run --issues-exit-code=0 --fix ./...
14-
# buf format --write
14+
buf format --write
1515

1616
BREAKING_CHANGE_BASE_BRANCH?=develop
1717
.PHONY: lint
1818
lint:
1919
golangci-lint run --issues-exit-code=1 ./...
20-
# buf lint
20+
buf lint
2121
# buf breaking --against '.git#branch=$(BREAKING_CHANGE_BASE_BRANCH)'
2222

2323
.PHONY: codegen
2424
codegen:
25-
# find . -type f \( -name '*.pb.go' \) -delete
26-
# buf generate
25+
find . -type f \( -name '*.pb.go' \) -delete
26+
buf generate

buf.gen.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ managed:
33
enabled: true
44
override:
55
- file_option: go_package_prefix
6-
value: github.com/averak/protobq/protobuf
6+
value: github.com/averak/protobq/internal/protobuf
77
plugins:
88
- remote: buf.build/protocolbuffers/go:v1.35.2
9-
out: protobuf
9+
out: internal/protobuf
1010
opt: paths=source_relative

cmd/protobq/main.go

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package main
2+
3+
import (
4+
"log"
5+
"os"
6+
7+
"github.com/urfave/cli"
8+
)
9+
10+
func main() {
11+
if err := newCliApp().Run(os.Args); err != nil {
12+
log.Fatal(err)
13+
}
14+
}
15+
16+
func newCliApp() *cli.App {
17+
res := cli.NewApp()
18+
res.Name = "protobq"
19+
res.Usage = "A tool for idempotent schema management in BigQuery using Protocol Buffers."
20+
res.Commands = []cli.Command{
21+
{
22+
Name: "apply",
23+
Usage: "apply schema",
24+
Action: func(c *cli.Context) error {
25+
// TODO: implements me
26+
return nil
27+
},
28+
},
29+
{
30+
Name: "drop",
31+
Usage: "drop schema",
32+
Action: func(c *cli.Context) error {
33+
// TODO: implements me
34+
return nil
35+
},
36+
},
37+
}
38+
return res
39+
}

go.mod

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
module github.com/averak/protobq
22

33
go 1.23
4+
5+
require (
6+
github.com/urfave/cli v1.22.16
7+
google.golang.org/protobuf v1.35.2
8+
)
9+
10+
require (
11+
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
12+
github.com/russross/blackfriday/v2 v2.1.0 // indirect
13+
)

go.sum

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
2+
github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc=
3+
github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
4+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
5+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
6+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
7+
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
8+
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
9+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
10+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
11+
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
12+
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
13+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
14+
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
15+
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
16+
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
17+
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
18+
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
19+
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
20+
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
21+
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
22+
github.com/urfave/cli v1.22.16 h1:MH0k6uJxdwdeWQTwhSO42Pwr4YLrNLwBtg1MRgTqPdQ=
23+
github.com/urfave/cli v1.22.16/go.mod h1:EeJR6BKodywf4zciqrdw6hpCPk68JO9z5LazXZMn5Po=
24+
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
25+
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
26+
google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io=
27+
google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
28+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
29+
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
30+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
31+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
32+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

internal/protobuf/protobq/custom_option.pb.go

+259
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

main.go

-7
This file was deleted.

0 commit comments

Comments
 (0)