Versions in this module Expand all Collapse all v0 v0.1.10 Jun 15, 2022 v0.1.9 Jun 15, 2022 v0.1.8 Jun 15, 2022 v0.1.7 Jun 3, 2022 Changes in this version + const Version + var ErrConflict = errors.New("StatusCode=409 Conflict") + var ErrForbidden = errors.New("StatusCode=403 Forbidden") + var ErrNotFound = errors.New("StatusCode=404 Not Found") + type CollInfo struct + ConflictResolutionPolicy map[string]interface{} + Conflicts string + Docs string + Etag string + GeospatialConfig map[string]interface{} + Id string + IndexingPolicy map[string]interface{} + PartitionKey map[string]interface{} + Rid string + Self string + Sprocs string + Triggers string + Ts int64 + Udfs string + type CollectionSpec struct + CollName string + DbName string + IndexingPolicy map[string]interface{} + MaxRu int + PartitionKeyInfo map[string]interface{} + Ru int + UniqueKeyPolicy map[string]interface{} + type Conn struct + func (c *Conn) Begin() (driver.Tx, error) + func (c *Conn) CheckNamedValue(value *driver.NamedValue) error + func (c *Conn) Close() error + func (c *Conn) Prepare(query string) (driver.Stmt, error) + type DatabaseSpec struct + Id string + MaxRu int + Ru int + type DbInfo struct + Colls string + Etag string + Id string + Rid string + Self string + Ts int64 + Users string + type DocInfo map[string]interface + func (d DocInfo) Attachments() string + func (d DocInfo) Etag() string + func (d DocInfo) GetAttrAsType(attrName string, typ reflect.Type) (interface{}, error) + func (d DocInfo) GetAttrAsTypeUnsafe(attrName string, typ reflect.Type) interface{} + func (d DocInfo) Id() string + func (d DocInfo) RemoveSystemAttrs() DocInfo + func (d DocInfo) Rid() string + func (d DocInfo) Self() string + func (d DocInfo) Ts() int64 + func (d DocInfo) TsAsTime() time.Time + type DocReq struct + CollName string + ConsistencyLevel string + DbName string + DocId string + MatchEtag string + NotMatchEtag string + PartitionKeyValues []interface{} + SessionToken string + type DocumentSpec struct + CollName string + DbName string + DocumentData map[string]interface{} + IndexingDirective string + IsUpsert bool + PartitionKeyValues []interface{} + type Driver struct + func (d *Driver) Open(connStr string) (driver.Conn, error) + type ListDocsReq struct + CollName string + ConsistencyLevel string + ContinuationToken string + DbName string + MaxItemCount int + NotMatchEtag string + PartitionKeyRangeId string + SessionToken string + type OfferInfo struct + Content map[string]interface{} + Etag string + Id string + OfferResourceId string + OfferType string + OfferVersion string + Resource string + Rid string + Self string + Ts int64 + func (o OfferInfo) IsAutopilot() bool + func (o OfferInfo) MaxThroughputEverProvisioned() int + func (o OfferInfo) OfferThroughput() int + type PkrangeInfo struct + Etag string + Id string + MaxExclusive string + MinInclusive string + Rid string + Self string + Ts int64 + type QueryReq struct + CollName string + ConsistencyLevel string + ContinuationToken string + CrossPartitionEnabled bool + DbName string + MaxItemCount int + Params []interface{} + Query string + SessionToken string + type RespCreateColl struct + type RespCreateDb struct + type RespCreateDoc struct + type RespDeleteColl struct + type RespDeleteDb struct + type RespDeleteDoc struct + type RespGetColl struct + type RespGetDb struct + type RespGetDoc struct + type RespGetOffer struct + type RespGetPkranges struct + Count int64 + Pkranges []PkrangeInfo + type RespListColl struct + Collections []CollInfo + Count int64 + type RespListDb struct + Count int64 + Databases []DbInfo + type RespListDocs struct + ContinuationToken string + Count int64 + Documents []DocInfo + Etag string + type RespQueryDocs struct + ContinuationToken string + Count int64 + Documents []DocInfo + type RespQueryOffers struct + ContinuationToken string + Count int64 + Offers []OfferInfo + type RespReplaceColl struct + type RespReplaceDoc struct + type RespReplaceOffer struct + type RestClient struct + func NewRestClient(httpClient *http.Client, connStr string) (*RestClient, error) + func (c *RestClient) CreateCollection(spec CollectionSpec) *RespCreateColl + func (c *RestClient) CreateDatabase(spec DatabaseSpec) *RespCreateDb + func (c *RestClient) CreateDocument(spec DocumentSpec) *RespCreateDoc + func (c *RestClient) DeleteCollection(dbName, collName string) *RespDeleteColl + func (c *RestClient) DeleteDatabase(dbName string) *RespDeleteDb + func (c *RestClient) DeleteDocument(r DocReq) *RespDeleteDoc + func (c *RestClient) GetCollection(dbName, collName string) *RespGetColl + func (c *RestClient) GetDatabase(dbName string) *RespGetDb + func (c *RestClient) GetDocument(r DocReq) *RespGetDoc + func (c *RestClient) GetOfferForResource(rid string) *RespGetOffer + func (c *RestClient) GetPkranges(dbName, collName string) *RespGetPkranges + func (c *RestClient) ListCollections(dbName string) *RespListColl + func (c *RestClient) ListDatabases() *RespListDb + func (c *RestClient) ListDocuments(r ListDocsReq) *RespListDocs + func (c *RestClient) QueryDocuments(query QueryReq) *RespQueryDocs + func (c *RestClient) QueryOffers(query string) *RespQueryOffers + func (c *RestClient) ReplaceCollection(spec CollectionSpec) *RespReplaceColl + func (c *RestClient) ReplaceDocument(matchEtag string, spec DocumentSpec) *RespReplaceDoc + func (c *RestClient) ReplaceOfferForResource(rid string, ru, maxru int) *RespReplaceOffer + type RestReponse struct + ApiErr error + CallErr error + RequestCharge float64 + RespBody []byte + RespHeader map[string]string + SessionToken string + StatusCode int + func (r RestReponse) Error() error + type ResultAlterCollection struct + Successful bool + func (r *ResultAlterCollection) LastInsertId() (int64, error) + func (r *ResultAlterCollection) RowsAffected() (int64, error) + type ResultAlterDatabase struct + Successful bool + func (r *ResultAlterDatabase) LastInsertId() (int64, error) + func (r *ResultAlterDatabase) RowsAffected() (int64, error) + type ResultCreateCollection struct + InsertId string + Successful bool + func (r *ResultCreateCollection) LastInsertId() (int64, error) + func (r *ResultCreateCollection) RowsAffected() (int64, error) + type ResultCreateDatabase struct + InsertId string + Successful bool + func (r *ResultCreateDatabase) LastInsertId() (int64, error) + func (r *ResultCreateDatabase) RowsAffected() (int64, error) + type ResultDelete struct + StatusCode int + Successful bool + func (r *ResultDelete) LastInsertId() (int64, error) + func (r *ResultDelete) RowsAffected() (int64, error) + type ResultInsert struct + InsertId string + Successful bool + func (r *ResultInsert) LastInsertId() (int64, error) + func (r *ResultInsert) RowsAffected() (int64, error) + type ResultSelect struct + func (r *ResultSelect) Close() error + func (r *ResultSelect) Columns() []string + func (r *ResultSelect) Next(dest []driver.Value) error + type ResultUpdate struct + Successful bool + func (r *ResultUpdate) LastInsertId() (int64, error) + func (r *ResultUpdate) RowsAffected() (int64, error) + type RowsListCollections struct + func (r *RowsListCollections) Close() error + func (r *RowsListCollections) Columns() []string + func (r *RowsListCollections) Next(dest []driver.Value) error + type RowsListDatabases struct + func (r *RowsListDatabases) Close() error + func (r *RowsListDatabases) Columns() []string + func (r *RowsListDatabases) Next(dest []driver.Value) error + type Stmt struct + func (s *Stmt) Close() error + func (s *Stmt) NumInput() int + type StmtAlterCollection struct + func (s *StmtAlterCollection) Exec(_ []driver.Value) (driver.Result, error) + func (s *StmtAlterCollection) Query(_ []driver.Value) (driver.Rows, error) + type StmtAlterDatabase struct + func (s *StmtAlterDatabase) Exec(_ []driver.Value) (driver.Result, error) + func (s *StmtAlterDatabase) Query(_ []driver.Value) (driver.Rows, error) + type StmtCreateCollection struct + func (s *StmtCreateCollection) Exec(_ []driver.Value) (driver.Result, error) + func (s *StmtCreateCollection) Query(_ []driver.Value) (driver.Rows, error) + type StmtCreateDatabase struct + func (s *StmtCreateDatabase) Exec(_ []driver.Value) (driver.Result, error) + func (s *StmtCreateDatabase) Query(_ []driver.Value) (driver.Rows, error) + type StmtDelete struct + func (s *StmtDelete) Exec(args []driver.Value) (driver.Result, error) + func (s *StmtDelete) Query(args []driver.Value) (driver.Rows, error) + type StmtDropCollection struct + func (s *StmtDropCollection) Exec(_ []driver.Value) (driver.Result, error) + func (s *StmtDropCollection) Query(_ []driver.Value) (driver.Rows, error) + type StmtDropDatabase struct + func (s *StmtDropDatabase) Exec(_ []driver.Value) (driver.Result, error) + func (s *StmtDropDatabase) Query(_ []driver.Value) (driver.Rows, error) + type StmtInsert struct + func (s *StmtInsert) Exec(args []driver.Value) (driver.Result, error) + func (s *StmtInsert) Query(args []driver.Value) (driver.Rows, error) + type StmtListCollections struct + func (s *StmtListCollections) Exec(_ []driver.Value) (driver.Result, error) + func (s *StmtListCollections) Query(_ []driver.Value) (driver.Rows, error) + type StmtListDatabases struct + func (s *StmtListDatabases) Exec(_ []driver.Value) (driver.Result, error) + func (s *StmtListDatabases) Query(_ []driver.Value) (driver.Rows, error) + type StmtSelect struct + func (s *StmtSelect) Exec(args []driver.Value) (driver.Result, error) + func (s *StmtSelect) Query(args []driver.Value) (driver.Rows, error) + type StmtUpdate struct + func (s *StmtUpdate) Exec(args []driver.Value) (driver.Result, error) + func (s *StmtUpdate) Query(args []driver.Value) (driver.Rows, error)