mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-10 13:37:08 +08:00
hack: generate vtproto files for buildx
Integrates vtproto into buildx. The generated files dockerfile has been modified to copy the buildkit equivalent file to ensure files are laid out in the appropriate way for imports. An import has also been included to change the grpc codec to the version in buildkit that supports vtproto. This will allow buildx to utilize the speed and memory improvements from that. Also updates the gc control options for prune. Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
This commit is contained in:
34
vendor/github.com/planetscale/vtprotobuf/features/grpc/grpc_plugin.go
generated
vendored
Normal file
34
vendor/github.com/planetscale/vtprotobuf/features/grpc/grpc_plugin.go
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
// Copyright (c) 2021 PlanetScale Inc. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package grpc
|
||||
|
||||
import (
|
||||
"github.com/planetscale/vtprotobuf/generator"
|
||||
"google.golang.org/protobuf/compiler/protogen"
|
||||
)
|
||||
|
||||
const version = "1.1.0-vtproto"
|
||||
|
||||
var requireUnimplementedAlways = true
|
||||
var requireUnimplemented = &requireUnimplementedAlways
|
||||
|
||||
func init() {
|
||||
generator.RegisterFeature("grpc", func(gen *generator.GeneratedFile) generator.FeatureGenerator {
|
||||
return &grpc{gen}
|
||||
})
|
||||
}
|
||||
|
||||
type grpc struct {
|
||||
*generator.GeneratedFile
|
||||
}
|
||||
|
||||
func (g *grpc) GenerateFile(file *protogen.File) bool {
|
||||
if len(file.Services) == 0 {
|
||||
return false
|
||||
}
|
||||
|
||||
generateFileContent(nil, file, g.GeneratedFile)
|
||||
return true
|
||||
}
|
Reference in New Issue
Block a user