Documentation
¶
Index ¶
- Variables
- func IsErrorStatusCode(err error, statusCode int) bool
- func RetryOnPreconditionFailed(f func() error) (err error)
- type AsyncOperationDocumentClient
- type AsyncOperationDocumentIterator
- type AsyncOperationDocumentRawIterator
- type BillingDocumentClient
- type BillingDocumentIterator
- type BillingDocumentRawIterator
- type Collection
- type CollectionClient
- type CollectionIterator
- type Collections
- type ConflictResolutionPolicy
- type ConflictResolutionPolicyMode
- type Database
- type DatabaseClient
- type DatabaseIterator
- type Databases
- type Error
- type ExcludedPath
- type GeospatialConfig
- type GeospatialConfigType
- type IncludedPath
- type Index
- type IndexDataType
- type IndexKind
- type IndexingPolicy
- type IndexingPolicyMode
- type MonitorDocumentClient
- type MonitorDocumentIterator
- type MonitorDocumentRawIterator
- type OpenShiftClusterDocumentClient
- type OpenShiftClusterDocumentIterator
- type OpenShiftClusterDocumentRawIterator
- type Options
- type Parameter
- type PartitionKey
- type PartitionKeyKind
- type PartitionKeyRange
- type PartitionKeyRangeStatus
- type PartitionKeyRanges
- type Query
- type SubscriptionDocumentClient
- type SubscriptionDocumentIterator
- type SubscriptionDocumentRawIterator
- type Trigger
- type TriggerClient
- type TriggerIterator
- type TriggerOperation
- type TriggerType
- type Triggers
Constants ¶
This section is empty.
Variables ¶
var ErrETagRequired = fmt.Errorf("ETag is required")
ErrETagRequired is the error returned if the ETag field is not populate on a PUT or DELETE operation
Functions ¶
func IsErrorStatusCode ¶
IsErrorStatusCode returns true if err is of type Error and its StatusCode matches statusCode
func RetryOnPreconditionFailed ¶
RetryOnPreconditionFailed retries a function if it fails due to PreconditionFailed
Types ¶
type AsyncOperationDocumentClient ¶
type AsyncOperationDocumentClient interface {
Create(context.Context, string, *pkg.AsyncOperationDocument, *Options) (*pkg.AsyncOperationDocument, error)
List(*Options) AsyncOperationDocumentRawIterator
ListAll(context.Context, *Options) (*pkg.AsyncOperationDocuments, error)
Get(context.Context, string, string, *Options) (*pkg.AsyncOperationDocument, error)
Replace(context.Context, string, *pkg.AsyncOperationDocument, *Options) (*pkg.AsyncOperationDocument, error)
Delete(context.Context, string, *pkg.AsyncOperationDocument, *Options) error
Query(string, *Query, *Options) AsyncOperationDocumentRawIterator
QueryAll(context.Context, string, *Query, *Options) (*pkg.AsyncOperationDocuments, error)
ChangeFeed(*Options) AsyncOperationDocumentIterator
}
AsyncOperationDocumentClient is a asyncOperationDocument client
func NewAsyncOperationDocumentClient ¶
func NewAsyncOperationDocumentClient(collc CollectionClient, collid string) AsyncOperationDocumentClient
NewAsyncOperationDocumentClient returns a new asyncOperationDocument client
type AsyncOperationDocumentIterator ¶
type AsyncOperationDocumentIterator interface {
Next(context.Context) (*pkg.AsyncOperationDocuments, error)
}
AsyncOperationDocumentIterator is a asyncOperationDocument iterator
type AsyncOperationDocumentRawIterator ¶
type AsyncOperationDocumentRawIterator interface {
AsyncOperationDocumentIterator
NextRaw(context.Context, interface{}) error
}
AsyncOperationDocumentRawIterator is a asyncOperationDocument raw iterator
type BillingDocumentClient ¶
type BillingDocumentClient interface {
Create(context.Context, string, *pkg.BillingDocument, *Options) (*pkg.BillingDocument, error)
List(*Options) BillingDocumentRawIterator
ListAll(context.Context, *Options) (*pkg.BillingDocuments, error)
Get(context.Context, string, string, *Options) (*pkg.BillingDocument, error)
Replace(context.Context, string, *pkg.BillingDocument, *Options) (*pkg.BillingDocument, error)
Delete(context.Context, string, *pkg.BillingDocument, *Options) error
Query(string, *Query, *Options) BillingDocumentRawIterator
QueryAll(context.Context, string, *Query, *Options) (*pkg.BillingDocuments, error)
ChangeFeed(*Options) BillingDocumentIterator
}
BillingDocumentClient is a billingDocument client
func NewBillingDocumentClient ¶
func NewBillingDocumentClient(collc CollectionClient, collid string) BillingDocumentClient
NewBillingDocumentClient returns a new billingDocument client
type BillingDocumentIterator ¶
type BillingDocumentIterator interface {
Next(context.Context) (*pkg.BillingDocuments, error)
}
BillingDocumentIterator is a billingDocument iterator
type BillingDocumentRawIterator ¶
type BillingDocumentRawIterator interface {
BillingDocumentIterator
NextRaw(context.Context, interface{}) error
}
BillingDocumentRawIterator is a billingDocument raw iterator
type Collection ¶
type Collection struct {
ID string `json:"id,omitempty"`
ResourceID string `json:"_rid,omitempty"`
Timestamp int `json:"_ts,omitempty"`
Self string `json:"_self,omitempty"`
ETag string `json:"_etag,omitempty"`
Documents string `json:"_docs,omitempty"`
StoredProcedures string `json:"_sprocs,omitempty"`
Triggers string `json:"_triggers,omitempty"`
UserDefinedFunctions string `json:"_udfs,omitempty"`
Conflicts string `json:"_conflicts,omitempty"`
IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"`
PartitionKey *PartitionKey `json:"partitionKey,omitempty"`
ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`
GeospatialConfig *GeospatialConfig `json:"geospatialConfig,omitempty"`
}
Collection represents a collection
type CollectionClient ¶
type CollectionClient interface {
Create(context.Context, *Collection) (*Collection, error)
List() CollectionIterator
ListAll(context.Context) (*Collections, error)
Get(context.Context, string) (*Collection, error)
Delete(context.Context, *Collection) error
Replace(context.Context, *Collection) (*Collection, error)
PartitionKeyRanges(context.Context, string) (*PartitionKeyRanges, error)
}
CollectionClient is a collection client
func NewCollectionClient ¶
func NewCollectionClient(c DatabaseClient, dbid string) CollectionClient
NewCollectionClient returns a new collection client
type CollectionIterator ¶
type CollectionIterator interface {
Next(context.Context) (*Collections, error)
}
CollectionIterator is a collection iterator
type Collections ¶
type Collections struct {
Count int `json:"_count,omitempty"`
ResourceID string `json:"_rid,omitempty"`
Collections []*Collection `json:"DocumentCollections,omitempty"`
}
Collections represents collections
type ConflictResolutionPolicy ¶
type ConflictResolutionPolicy struct {
Mode ConflictResolutionPolicyMode `json:"mode,omitempty"`
ConflictResolutionPath string `json:"conflictResolutionPath,omitempty"`
ConflictResolutionProcedure string `json:"conflictResolutionProcedure,omitempty"`
}
ConflictResolutionPolicy represents a conflict resolution policy
type ConflictResolutionPolicyMode ¶
type ConflictResolutionPolicyMode string
ConflictResolutionPolicyMode represents a conflict resolution policy mode
const ( ConflictResolutionPolicyModeLastWriterWins ConflictResolutionPolicyMode = "LastWriterWins" ConflictResolutionPolicyModeCustom ConflictResolutionPolicyMode = "Custom" )
ConflictResolutionPolicyMode constants
type Database ¶
type Database struct {
ID string `json:"id,omitempty"`
ResourceID string `json:"_rid,omitempty"`
Timestamp int `json:"_ts,omitempty"`
Self string `json:"_self,omitempty"`
ETag string `json:"_etag,omitempty"`
Collections string `json:"_colls,omitempty"`
Users string `json:"_users,omitempty"`
}
Database represents a database
type DatabaseClient ¶
type DatabaseClient interface {
Create(context.Context, *Database) (*Database, error)
List() DatabaseIterator
ListAll(context.Context) (*Databases, error)
Get(context.Context, string) (*Database, error)
Delete(context.Context, *Database) error
}
DatabaseClient is a database client
func NewDatabaseClient ¶
func NewDatabaseClient(log *logrus.Entry, hc *http.Client, jsonHandle *codec.JsonHandle, databaseAccount, masterKey string) (DatabaseClient, error)
NewDatabaseClient returns a new database client
type DatabaseIterator ¶
DatabaseIterator is a database iterator
type Databases ¶
type Databases struct {
Count int `json:"_count,omitempty"`
ResourceID string `json:"_rid,omitempty"`
Databases []*Database `json:"Databases,omitempty"`
}
Databases represents databases
type ExcludedPath ¶
type ExcludedPath struct {
Path string `json:"path,omitempty"`
}
ExcludedPath represents an excluded path
type GeospatialConfig ¶
type GeospatialConfig struct {
Type GeospatialConfigType `json:"type,omitempty"`
}
GeospatialConfig represents a geospatial config
type GeospatialConfigType ¶
type GeospatialConfigType string
GeospatialConfigType represents geospatial config types
const (
GeospatialConfigTypeGeography GeospatialConfigType = "Geography"
)
GeospatialConfigType constants
type IncludedPath ¶
type IncludedPath struct {
Path string `json:"path,omitempty"`
Indexes []Index `json:"indexes,omitempty"`
}
IncludedPath represents an included path
type Index ¶
type Index struct {
DataType IndexDataType `json:"dataType,omitempty"`
Kind IndexKind `json:"kind,omitempty"`
Precision int `json:"precision,omitempty"`
}
Index represents an index
type IndexDataType ¶
type IndexDataType string
IndexDataType represents an index data type
const ( IndexDataTypeString IndexDataType = "String" IndexDataTypeNumber IndexDataType = "Number" IndexDataTypePoint IndexDataType = "Point" IndexDataTypePolygon IndexDataType = "Polygon" IndexDataTypeLineString IndexDataType = "LineString" )
IndexDataType constants
type IndexingPolicy ¶
type IndexingPolicy struct {
Automatic bool `json:"automatic,omitempty"`
IndexingMode IndexingPolicyMode `json:"indexingMode,omitempty"`
IncludedPaths []IncludedPath `json:"includedPaths,omitempty"`
ExcludedPaths []IncludedPath `json:"excludedPaths,omitempty"`
}
IndexingPolicy represents an indexing policy
type IndexingPolicyMode ¶
type IndexingPolicyMode string
IndexingPolicyMode represents an indexing policy mode
const ( IndexingPolicyModeConsistent IndexingPolicyMode = "Consistent" IndexingPolicyModeLazy IndexingPolicyMode = "Lazy" )
IndexingPolicyMode constants
type MonitorDocumentClient ¶
type MonitorDocumentClient interface {
Create(context.Context, string, *pkg.MonitorDocument, *Options) (*pkg.MonitorDocument, error)
List(*Options) MonitorDocumentRawIterator
ListAll(context.Context, *Options) (*pkg.MonitorDocuments, error)
Get(context.Context, string, string, *Options) (*pkg.MonitorDocument, error)
Replace(context.Context, string, *pkg.MonitorDocument, *Options) (*pkg.MonitorDocument, error)
Delete(context.Context, string, *pkg.MonitorDocument, *Options) error
Query(string, *Query, *Options) MonitorDocumentRawIterator
QueryAll(context.Context, string, *Query, *Options) (*pkg.MonitorDocuments, error)
ChangeFeed(*Options) MonitorDocumentIterator
}
MonitorDocumentClient is a monitorDocument client
func NewMonitorDocumentClient ¶
func NewMonitorDocumentClient(collc CollectionClient, collid string) MonitorDocumentClient
NewMonitorDocumentClient returns a new monitorDocument client
type MonitorDocumentIterator ¶
type MonitorDocumentIterator interface {
Next(context.Context) (*pkg.MonitorDocuments, error)
}
MonitorDocumentIterator is a monitorDocument iterator
type MonitorDocumentRawIterator ¶
type MonitorDocumentRawIterator interface {
MonitorDocumentIterator
NextRaw(context.Context, interface{}) error
}
MonitorDocumentRawIterator is a monitorDocument raw iterator
type OpenShiftClusterDocumentClient ¶
type OpenShiftClusterDocumentClient interface {
Create(context.Context, string, *pkg.OpenShiftClusterDocument, *Options) (*pkg.OpenShiftClusterDocument, error)
List(*Options) OpenShiftClusterDocumentRawIterator
ListAll(context.Context, *Options) (*pkg.OpenShiftClusterDocuments, error)
Get(context.Context, string, string, *Options) (*pkg.OpenShiftClusterDocument, error)
Replace(context.Context, string, *pkg.OpenShiftClusterDocument, *Options) (*pkg.OpenShiftClusterDocument, error)
Delete(context.Context, string, *pkg.OpenShiftClusterDocument, *Options) error
Query(string, *Query, *Options) OpenShiftClusterDocumentRawIterator
QueryAll(context.Context, string, *Query, *Options) (*pkg.OpenShiftClusterDocuments, error)
ChangeFeed(*Options) OpenShiftClusterDocumentIterator
}
OpenShiftClusterDocumentClient is a openShiftClusterDocument client
func NewOpenShiftClusterDocumentClient ¶
func NewOpenShiftClusterDocumentClient(collc CollectionClient, collid string) OpenShiftClusterDocumentClient
NewOpenShiftClusterDocumentClient returns a new openShiftClusterDocument client
type OpenShiftClusterDocumentIterator ¶
type OpenShiftClusterDocumentIterator interface {
Next(context.Context) (*pkg.OpenShiftClusterDocuments, error)
}
OpenShiftClusterDocumentIterator is a openShiftClusterDocument iterator
type OpenShiftClusterDocumentRawIterator ¶
type OpenShiftClusterDocumentRawIterator interface {
OpenShiftClusterDocumentIterator
NextRaw(context.Context, interface{}) error
}
OpenShiftClusterDocumentRawIterator is a openShiftClusterDocument raw iterator
type Options ¶
type Options struct {
NoETag bool
PreTriggers []string
PostTriggers []string
PartitionKeyRangeID string
}
Options represents API options
type PartitionKey ¶
type PartitionKey struct {
Paths []string `json:"paths,omitempty"`
Kind PartitionKeyKind `json:"kind,omitempty"`
Version int `json:"version,omitempty"`
}
PartitionKey represents a partition key
type PartitionKeyKind ¶
type PartitionKeyKind string
PartitionKeyKind represents a partition key kind
const (
PartitionKeyKindHash PartitionKeyKind = "Hash"
)
PartitionKeyKind constants
type PartitionKeyRange ¶
type PartitionKeyRange struct {
ID string `json:"id,omitempty"`
ResourceID string `json:"_rid,omitempty"`
Timestamp int `json:"_ts,omitempty"`
Self string `json:"_self,omitempty"`
ETag string `json:"_etag,omitempty"`
MaxExclusive string `json:"maxExclusive,omitempty"`
MinInclusive string `json:"minInclusive,omitempty"`
ResourceIDPrefix int `json:"ridPrefix,omitempty"`
ThroughputFraction int `json:"throughputFraction,omitempty"`
Status PartitionKeyRangeStatus `json:"status,omitempty"`
Parents []string `json:"parents,omitempty"`
}
PartitionKeyRange represents a partition key range
type PartitionKeyRangeStatus ¶
type PartitionKeyRangeStatus string
PartitionKeyRangeStatus represents a partition key range status
const (
PartitionKeyRangeStatusOnline PartitionKeyRangeStatus = "online"
)
PartitionKeyRangeStatus constants
type PartitionKeyRanges ¶
type PartitionKeyRanges struct {
Count int `json:"_count,omitempty"`
ResourceID string `json:"_rid,omitempty"`
PartitionKeyRanges []PartitionKeyRange `json:"PartitionKeyRanges,omitempty"`
}
PartitionKeyRanges represents partition key ranges
type Query ¶
type Query struct {
Query string `json:"query,omitempty"`
Parameters []Parameter `json:"parameters,omitempty"`
}
Query represents a query
type SubscriptionDocumentClient ¶
type SubscriptionDocumentClient interface {
Create(context.Context, string, *pkg.SubscriptionDocument, *Options) (*pkg.SubscriptionDocument, error)
List(*Options) SubscriptionDocumentRawIterator
ListAll(context.Context, *Options) (*pkg.SubscriptionDocuments, error)
Get(context.Context, string, string, *Options) (*pkg.SubscriptionDocument, error)
Replace(context.Context, string, *pkg.SubscriptionDocument, *Options) (*pkg.SubscriptionDocument, error)
Delete(context.Context, string, *pkg.SubscriptionDocument, *Options) error
Query(string, *Query, *Options) SubscriptionDocumentRawIterator
QueryAll(context.Context, string, *Query, *Options) (*pkg.SubscriptionDocuments, error)
ChangeFeed(*Options) SubscriptionDocumentIterator
}
SubscriptionDocumentClient is a subscriptionDocument client
func NewSubscriptionDocumentClient ¶
func NewSubscriptionDocumentClient(collc CollectionClient, collid string) SubscriptionDocumentClient
NewSubscriptionDocumentClient returns a new subscriptionDocument client
type SubscriptionDocumentIterator ¶
type SubscriptionDocumentIterator interface {
Next(context.Context) (*pkg.SubscriptionDocuments, error)
}
SubscriptionDocumentIterator is a subscriptionDocument iterator
type SubscriptionDocumentRawIterator ¶
type SubscriptionDocumentRawIterator interface {
SubscriptionDocumentIterator
NextRaw(context.Context, interface{}) error
}
SubscriptionDocumentRawIterator is a subscriptionDocument raw iterator
type Trigger ¶
type Trigger struct {
ID string `json:"id,omitempty"`
ResourceID string `json:"_rid,omitempty"`
Timestamp int `json:"_ts,omitempty"`
Self string `json:"_self,omitempty"`
ETag string `json:"_etag,omitempty"`
Body string `json:"body,omitempty"`
TriggerOperation TriggerOperation `json:"triggerOperation,omitempty"`
TriggerType TriggerType `json:"triggerType,omitempty"`
}
Trigger represents a trigger
type TriggerClient ¶
type TriggerClient interface {
Create(context.Context, *Trigger) (*Trigger, error)
List() TriggerIterator
ListAll(context.Context) (*Triggers, error)
Get(context.Context, string) (*Trigger, error)
Delete(context.Context, *Trigger) error
Replace(context.Context, *Trigger) (*Trigger, error)
}
TriggerClient is a trigger client
func NewTriggerClient ¶
func NewTriggerClient(collc CollectionClient, collid string) TriggerClient
NewTriggerClient returns a new trigger client
type TriggerIterator ¶
TriggerIterator is a trigger iterator
type TriggerOperation ¶
type TriggerOperation string
TriggerOperation represents a trigger operation
const ( TriggerOperationAll TriggerOperation = "All" TriggerOperationCreate TriggerOperation = "Create" TriggerOperationReplace TriggerOperation = "Replace" TriggerOperationDelete TriggerOperation = "Delete" )
TriggerOperation constants
type TriggerType ¶
type TriggerType string
TriggerType represents a trigger type
const ( TriggerTypePre TriggerType = "Pre" TriggerTypePost TriggerType = "Post" )
TriggerType constants
Source Files
¶
- generate.go
- zz_generated_asyncoperationdocument.go
- zz_generated_billingdocument.go
- zz_generated_collection.go
- zz_generated_cosmosdb.go
- zz_generated_database.go
- zz_generated_document.go
- zz_generated_monitordocument.go
- zz_generated_openshiftclusterdocument.go
- zz_generated_subscriptiondocument.go
- zz_generated_trigger.go