mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
flow: move schemas into a dedicated directory
This helps exposing them with docker-compose.
This commit is contained in:
4
Makefile
4
Makefile
@@ -47,8 +47,8 @@ $(BIN)/protoc-gen-go: PACKAGE=google.golang.org/protobuf/cmd/protoc-gen-go
|
||||
|
||||
# Generated files
|
||||
|
||||
%.pb.go: %.proto | $(PROTOC_GEN_GO) ; $(info $(M) compiling protocol buffers definition…)
|
||||
$Q $(PROTOC) -I=. --plugin=$(PROTOC_GEN_GO) --go_out=. --go_opt=paths=source_relative $<
|
||||
flow/%.pb.go: flow/data/schemas/%.proto | $(PROTOC_GEN_GO) ; $(info $(M) compiling protocol buffers definition…)
|
||||
$Q $(PROTOC) -I=. --plugin=$(PROTOC_GEN_GO) --go_out=. --go_opt=module=$(MODULE) $<
|
||||
|
||||
web/data: mkdocs.yml $(wildcard docs/*.md docs/assets/*) ; $(info $(M) build documentation) @ ## Build documentation
|
||||
$Q rm -rf web/data
|
||||
|
||||
@@ -30,4 +30,4 @@ services:
|
||||
- 8123:8123/tcp
|
||||
- 9000:9000/tcp
|
||||
volumes:
|
||||
- ./flow/flow-v0.proto:/var/lib/clickhouse/format_schemas/flow-v0.proto:ro
|
||||
- ./flow/data/schemas:/var/lib/clickhouse/format_schemas:ro
|
||||
|
||||
@@ -16,13 +16,13 @@ const CurrentSchemaVersion = 0
|
||||
var (
|
||||
// VersionedSchemas is a mapping from schema version to protobuf definitions
|
||||
VersionedSchemas map[int]string
|
||||
//go:embed flow*.proto
|
||||
//go:embed data/schemas/flow*.proto
|
||||
schemas embed.FS
|
||||
)
|
||||
|
||||
func init() {
|
||||
VersionedSchemas = make(map[int]string)
|
||||
entries, err := schemas.ReadDir(".")
|
||||
entries, err := schemas.ReadDir("data/schemas")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -34,7 +34,7 @@ func init() {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
f, err := schemas.Open(entry.Name())
|
||||
f, err := schemas.Open(fmt.Sprintf("data/schemas/%s", entry.Name()))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
Reference in New Issue
Block a user