mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 22:19:40 -08:00
Move protobuf descriptor and add content-type.
- move to static/generated - set content-type based on extension '.description'
This commit is contained in:
parent
9e02c2393a
commit
1f96d4c822
|
@ -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
|
||||||
|
|
|
@ -15,14 +15,8 @@ all: files.go
|
||||||
|
|
||||||
SUFFIXES:
|
SUFFIXES:
|
||||||
|
|
||||||
generated:
|
files.go: $(shell find ../templates/ ../static/ -type f)
|
||||||
mkdir -vp generated
|
../../utility/embed-static.sh ../static ../templates | gofmt > $@
|
||||||
|
|
||||||
generated/protocol_buffer.descriptor: generated ../../model/generated/descriptor.blob
|
|
||||||
cp ../../model/generated/descriptor.blob -f $@
|
|
||||||
|
|
||||||
files.go: $(shell find ../templates/ ../static/ -type f) generated/protocol_buffer.descriptor
|
|
||||||
../../utility/embed-static.sh ../static ../templates ./generated | gofmt > $@
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm files.go
|
-rm files.go
|
||||||
|
|
|
@ -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