Skip to content

Commit

Permalink
feat(influxdb): add doc meta type
Browse files Browse the repository at this point in the history
  • Loading branch information
kelwang committed Apr 15, 2019
1 parent 401ec79 commit 75b19dc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions document.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type Document struct {
// data in the meta should be indexed and queryable.
type DocumentMeta struct {
Name string `json:"name"`
Type string `json:"type,omitempty"`
Version string `json:"version,omitempty"`
}

Expand Down
5 changes: 4 additions & 1 deletion http/document_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ var (
ID: doc1ID,
Meta: influxdb.DocumentMeta{
Name: "doc1",
Type: "typ1",
},
Content: "content1",
Labels: []*influxdb.Label{
Expand Down Expand Up @@ -75,6 +76,7 @@ var (
ID: doc4ID,
Meta: influxdb.DocumentMeta{
Name: "doc4",
Type: "typ4",
},
Content: "content4",
}
Expand Down Expand Up @@ -122,7 +124,8 @@ var (
}
],
"meta": {
"name": "doc1"
"name": "doc1",
"type": "typ1"
}
},
{
Expand Down
2 changes: 2 additions & 0 deletions http/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7022,6 +7022,8 @@ components:
properties:
name:
type: string
type:
type: string
version:
type: string
required:
Expand Down
1 change: 1 addition & 0 deletions testing/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func NewDocumentIntegrationTest(store kv.Store) func(t *testing.T) {
d1 = &influxdb.Document{
Meta: influxdb.DocumentMeta{
Name: "i1",
Type: "type1",
},
Content: map[string]interface{}{
"v1": "v1",
Expand Down

0 comments on commit 75b19dc

Please sign in to comment.