Documentation ¶
Index ¶
- func ConstructMetadataDBName(dbName string) string
- func ConstructNamespaceDBName(chainName, namespace string) string
- func CreateSystemDatabasesIfNotExist(couchInstance *CouchInstance) error
- func IsJSON(s string) bool
- type AttachmentInfo
- type Base64Attachment
- type BatchRetrieveDocMetadataResponse
- type BatchUpdateResponse
- type Config
- type ConnectionInfo
- type CouchDBDef
- type CouchDatabase
- func (dbclient *CouchDatabase) ApplyDatabaseSecurity(databaseSecurity *DatabaseSecurity) error
- func (dbclient *CouchDatabase) BatchRetrieveDocumentMetadata(keys []string) ([]*DocMetadata, error)
- func (dbclient *CouchDatabase) BatchUpdateDocuments(documents []*CouchDoc) ([]*BatchUpdateResponse, error)
- func (dbclient *CouchDatabase) CreateDatabaseIfNotExist() error
- func (dbclient *CouchDatabase) CreateIndex(indexdefinition string) (*CreateIndexResponse, error)
- func (dbclient *CouchDatabase) DeleteDoc(id, rev string) error
- func (dbclient *CouchDatabase) DeleteIndex(designdoc, indexname string) error
- func (dbclient *CouchDatabase) DropDatabase() (*DBOperationResponse, error)
- func (dbclient *CouchDatabase) EnsureFullCommit() (*DBOperationResponse, error)
- func (dbclient *CouchDatabase) GetDatabaseInfo() (*DBInfo, *DBReturn, error)
- func (dbclient *CouchDatabase) GetDatabaseSecurity() (*DatabaseSecurity, error)
- func (dbclient *CouchDatabase) ListIndex() ([]*IndexResult, error)
- func (dbclient *CouchDatabase) QueryDocuments(query string) ([]*QueryResult, string, error)
- func (dbclient *CouchDatabase) ReadDoc(id string) (*CouchDoc, string, error)
- func (dbclient *CouchDatabase) ReadDocRange(startKey, endKey string, limit int32) ([]*QueryResult, string, error)
- func (dbclient *CouchDatabase) SaveDoc(id string, rev string, couchDoc *CouchDoc) (string, error)
- func (dbclient *CouchDatabase) WarmIndex(designdoc, indexname string) error
- func (dbclient *CouchDatabase) WarmIndexAllIndexes() error
- type CouchDoc
- type CouchInstance
- func (couchInstance *CouchInstance) HealthCheck(ctx context.Context) error
- func (couchInstance *CouchInstance) InternalQueryLimit() int32
- func (couchInstance *CouchInstance) MaxBatchUpdateSize() int
- func (couchInstance *CouchInstance) URL() string
- func (couchInstance *CouchInstance) VerifyCouchConfig() (*ConnectionInfo, *DBReturn, error)
- type CreateIndexResponse
- type DBInfo
- type DBOperationResponse
- type DBReturn
- type DatabaseSecurity
- type DocID
- type DocMetadata
- type FileDetails
- type IndexResult
- type QueryResponse
- type QueryResult
- type RangeQueryResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConstructMetadataDBName ¶
func CreateSystemDatabasesIfNotExist ¶
func CreateSystemDatabasesIfNotExist(couchInstance *CouchInstance) error
Types ¶
type AttachmentInfo ¶
type Base64Attachment ¶
type BatchUpdateResponse ¶
type ConnectionInfo ¶
type CouchDBDef ¶
type CouchDBDef struct { URL string Username string Password string MaxRetries int MaxRetriesOnStartup int RequestTimeout time.Duration CreateGlobalChangesDB bool }
func GetCouchDBDefinition ¶
func GetCouchDBDefinition() *CouchDBDef
type CouchDatabase ¶
type CouchDatabase struct { CouchInstance *CouchInstance DBName string IndexWarmCounter int }
func CreateCouchDatabase ¶
func CreateCouchDatabase(couchInstance *CouchInstance, dbName string) (*CouchDatabase, error)
func (*CouchDatabase) ApplyDatabaseSecurity ¶
func (dbclient *CouchDatabase) ApplyDatabaseSecurity(databaseSecurity *DatabaseSecurity) error
func (*CouchDatabase) BatchRetrieveDocumentMetadata ¶
func (dbclient *CouchDatabase) BatchRetrieveDocumentMetadata(keys []string) ([]*DocMetadata, error)
func (*CouchDatabase) BatchUpdateDocuments ¶
func (dbclient *CouchDatabase) BatchUpdateDocuments(documents []*CouchDoc) ([]*BatchUpdateResponse, error)
func (*CouchDatabase) CreateDatabaseIfNotExist ¶
func (dbclient *CouchDatabase) CreateDatabaseIfNotExist() error
func (*CouchDatabase) CreateIndex ¶
func (dbclient *CouchDatabase) CreateIndex(indexdefinition string) (*CreateIndexResponse, error)
func (*CouchDatabase) DeleteDoc ¶
func (dbclient *CouchDatabase) DeleteDoc(id, rev string) error
func (*CouchDatabase) DeleteIndex ¶
func (dbclient *CouchDatabase) DeleteIndex(designdoc, indexname string) error
func (*CouchDatabase) DropDatabase ¶
func (dbclient *CouchDatabase) DropDatabase() (*DBOperationResponse, error)
func (*CouchDatabase) EnsureFullCommit ¶
func (dbclient *CouchDatabase) EnsureFullCommit() (*DBOperationResponse, error)
func (*CouchDatabase) GetDatabaseInfo ¶
func (dbclient *CouchDatabase) GetDatabaseInfo() (*DBInfo, *DBReturn, error)
func (*CouchDatabase) GetDatabaseSecurity ¶
func (dbclient *CouchDatabase) GetDatabaseSecurity() (*DatabaseSecurity, error)
func (*CouchDatabase) ListIndex ¶
func (dbclient *CouchDatabase) ListIndex() ([]*IndexResult, error)
func (*CouchDatabase) QueryDocuments ¶
func (dbclient *CouchDatabase) QueryDocuments(query string) ([]*QueryResult, string, error)
func (*CouchDatabase) ReadDoc ¶
func (dbclient *CouchDatabase) ReadDoc(id string) (*CouchDoc, string, error)
func (*CouchDatabase) ReadDocRange ¶
func (dbclient *CouchDatabase) ReadDocRange(startKey, endKey string, limit int32) ([]*QueryResult, string, error)
func (*CouchDatabase) WarmIndex ¶
func (dbclient *CouchDatabase) WarmIndex(designdoc, indexname string) error
func (*CouchDatabase) WarmIndexAllIndexes ¶
func (dbclient *CouchDatabase) WarmIndexAllIndexes() error
type CouchDoc ¶
type CouchDoc struct { JSONValue []byte Attachments []*AttachmentInfo }
type CouchInstance ¶
type CouchInstance struct {
// contains filtered or unexported fields
}
func CreateCouchInstance ¶
func CreateCouchInstance(config *Config, metricsProvider metrics.Provider) (*CouchInstance, error)
func (*CouchInstance) HealthCheck ¶
func (couchInstance *CouchInstance) HealthCheck(ctx context.Context) error
func (*CouchInstance) InternalQueryLimit ¶
func (couchInstance *CouchInstance) InternalQueryLimit() int32
func (*CouchInstance) MaxBatchUpdateSize ¶
func (couchInstance *CouchInstance) MaxBatchUpdateSize() int
func (*CouchInstance) URL ¶
func (couchInstance *CouchInstance) URL() string
func (*CouchInstance) VerifyCouchConfig ¶
func (couchInstance *CouchInstance) VerifyCouchConfig() (*ConnectionInfo, *DBReturn, error)
type CreateIndexResponse ¶
type DBInfo ¶
type DBInfo struct { DbName string `json:"db_name"` Sizes struct { File int `json:"file"` External int `json:"external"` Active int `json:"active"` } `json:"sizes"` Other struct { DataSize int `json:"data_size"` } `json:"other"` DocDelCount int `json:"doc_del_count"` DocCount int `json:"doc_count"` DiskSize int `json:"disk_size"` DiskFormatVersion int `json:"disk_format_version"` DataSize int `json:"data_size"` CompactRunning bool `json:"compact_running"` InstanceStartTime string `json:"instance_start_time"` }
type DBOperationResponse ¶
type DBOperationResponse struct {
Ok bool
}
type DatabaseSecurity ¶
type DocMetadata ¶
type DocMetadata struct { ID string `json:"_id"` Rev string `json:"_rev"` Version string `json:"~version"` AttachmentsInfo map[string]*AttachmentInfo `json:"_attachments"` }
type FileDetails ¶
type IndexResult ¶
type QueryResponse ¶
type QueryResponse struct { Warning string `json:"warning"` Docs []json.RawMessage `json:"docs"` Bookmark string `json:"bookmark"` }
type QueryResult ¶
type QueryResult struct { ID string Value []byte Attachments []*AttachmentInfo }
type RangeQueryResponse ¶
Click to show internal directories.
Click to hide internal directories.