mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Merge pull request #179 from prometheus/feature/protocol-buffer-descriptor-inclusion
Include generated Protocol Buffer descriptor.
This commit is contained in:
commit
3ff916d209
2
Makefile
2
Makefile
|
@ -76,7 +76,7 @@ test: build
|
||||||
go test ./utility/... $(GO_TEST_FLAGS)
|
go test ./utility/... $(GO_TEST_FLAGS)
|
||||||
go test ./web/... $(GO_TEST_FLAGS)
|
go test ./web/... $(GO_TEST_FLAGS)
|
||||||
|
|
||||||
web: preparation
|
web: preparation model
|
||||||
$(MAKE) -C web
|
$(MAKE) -C web
|
||||||
|
|
||||||
.PHONY: advice binary build clean documentation format model package preparation run search_index source_path test
|
.PHONY: advice binary build clean documentation format model package preparation run search_index source_path test
|
||||||
|
|
|
@ -11,14 +11,18 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
all: generated
|
||||||
|
|
||||||
|
SUFFIXES:
|
||||||
|
|
||||||
MAKE_ARTIFACTS = generated-stamp
|
MAKE_ARTIFACTS = generated-stamp
|
||||||
|
|
||||||
all: generated
|
include ../Makefile.INCLUDE
|
||||||
|
|
||||||
generated: generated-stamp
|
generated: generated-stamp
|
||||||
|
|
||||||
generated-stamp: data.proto
|
generated-stamp: data.proto
|
||||||
protoc --go_out=generated/ data.proto
|
protoc --proto_path=$(PREFIX)/include:. --go_out=generated/ --descriptor_set_out=generated/descriptor.blob data.proto
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
|
@ -11,7 +11,9 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
package dto;
|
package io.prometheus;
|
||||||
|
|
||||||
|
import "google/protobuf/descriptor.proto";
|
||||||
|
|
||||||
message LabelPair {
|
message LabelPair {
|
||||||
optional string name = 1;
|
optional string name = 1;
|
||||||
|
|
6
model/generated/.gitignore
vendored
6
model/generated/.gitignore
vendored
|
@ -1,4 +1,2 @@
|
||||||
*.cc
|
data.pb.go
|
||||||
*.go
|
descriptor.blob
|
||||||
*.h
|
|
||||||
*.o
|
|
||||||
|
|
|
@ -13,10 +13,16 @@
|
||||||
|
|
||||||
all: blob
|
all: blob
|
||||||
|
|
||||||
blob:
|
blob: static/generated/protocol_buffer.descriptor
|
||||||
$(MAKE) -C blob
|
$(MAKE) -C blob
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(MAKE) -C blob clean
|
$(MAKE) -C blob clean
|
||||||
|
|
||||||
|
static/generated:
|
||||||
|
mkdir -vp static/generated
|
||||||
|
|
||||||
|
static/generated/protocol_buffer.descriptor: static/generated ../model/generated/descriptor.blob
|
||||||
|
cp ../model/generated/descriptor.blob -f $@
|
||||||
|
|
||||||
.PHONY: blob clean
|
.PHONY: blob clean
|
||||||
|
|
|
@ -13,10 +13,13 @@
|
||||||
|
|
||||||
all: files.go
|
all: files.go
|
||||||
|
|
||||||
|
SUFFIXES:
|
||||||
|
|
||||||
files.go: $(shell find ../templates/ ../static/ -type f)
|
files.go: $(shell find ../templates/ ../static/ -type f)
|
||||||
../../utility/embed-static.sh ../static ../templates | gofmt > $@
|
../../utility/embed-static.sh ../static ../templates | gofmt > $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm files.go
|
-rm files.go
|
||||||
|
-rm -rf generated
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
|
@ -16,8 +16,9 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
var mimeMap = map[string]string{
|
var mimeMap = map[string]string{
|
||||||
"css": "text/css",
|
"css": "text/css",
|
||||||
"js": "text/javascript",
|
"js": "text/javascript",
|
||||||
|
"descriptor": "application/vnd.google.protobuf;proto=google.protobuf.FileDescriptorSet",
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetFile(bucket string, name string) ([]byte, error) {
|
func GetFile(bucket string, name string) ([]byte, error) {
|
||||||
|
|
Loading…
Reference in a new issue