Merge pull request #13519 from influxdata/doc_desc

feat(influxdb): add doc description
pull/13562/head
kelwang 2019-04-24 14:11:03 -04:00 committed by GitHub
commit 4acad08ea5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 8 deletions

View File

@ -24,9 +24,10 @@ type Document struct {
// DocumentMeta is information that is universal across documents. Ideally
// 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"`
Name string `json:"name"`
Type string `json:"type,omitempty"`
Description string `json:"description,omitempty"`
Version string `json:"version,omitempty"`
}
// DocumentStore is used to perform CRUD operations on documents. It follows an options

View File

@ -46,8 +46,9 @@ var (
doc1 = influxdb.Document{
ID: doc1ID,
Meta: influxdb.DocumentMeta{
Name: "doc1",
Type: "typ1",
Name: "doc1",
Type: "typ1",
Description: "desc1",
},
Content: "content1",
Labels: []*influxdb.Label{
@ -125,7 +126,8 @@ var (
],
"meta": {
"name": "doc1",
"type": "typ1"
"type": "typ1",
"description": "desc1"
}
},
{

View File

@ -6959,6 +6959,8 @@ components:
type: string
type:
type: string
description:
type: string
version:
type: string
required:

View File

@ -60,8 +60,9 @@ func NewDocumentIntegrationTest(store kv.Store) func(t *testing.T) {
t.Run("u1 can create document for o1", func(t *testing.T) {
d1 = &influxdb.Document{
Meta: influxdb.DocumentMeta{
Name: "i1",
Type: "type1",
Name: "i1",
Type: "type1",
Description: "desc1",
},
Content: map[string]interface{}{
"v1": "v1",