代码拉取完成,页面将自动刷新
package influxdb
import (
"context"
"github.com/influxdata/influxdb/v2/kit/platform"
)
// ErrDocumentNotFound is the error msg for a missing document.
const ErrDocumentNotFound = "document not found"
// DocumentService is used to create/find instances of document stores.
type DocumentService interface {
CreateDocumentStore(ctx context.Context, name string) (DocumentStore, error)
FindDocumentStore(ctx context.Context, name string) (DocumentStore, error)
}
// Document is a generic structure for stating data.
type Document struct {
ID platform.ID `json:"id"`
Meta DocumentMeta `json:"meta"`
Content interface{} `json:"content,omitempty"` // TODO(desa): maybe this needs to be json.Marshaller & json.Unmarshaler
Labels []*Label `json:"labels,omitempty"` // read only
// This is needed for authorization.
// The service that passes documents around will take care of filling it
// via request parameters or others, as the kv store will take care of
// filling it once it returns a document.
// This is not stored in the kv store neither required in the API.
Organizations map[platform.ID]UserType `json:"-"`
}
// 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"`
Description string `json:"description,omitempty"`
Version string `json:"version,omitempty"`
CRUDLog
}
// DocumentStore is used to perform CRUD operations on documents. It follows an options
// pattern that allows users to perform actions related to documents in a transactional way.
type DocumentStore interface {
CreateDocument(ctx context.Context, d *Document) error
FindDocument(ctx context.Context, id platform.ID) (*Document, error)
FindDocuments(ctx context.Context, orgID platform.ID) ([]*Document, error)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。