Documentation
¶
Index ¶
- Variables
- func IsErrorStatusCode(err error, statusCode int) bool
- func RetryOnPreconditionFailed(f func() error) (err error)
- 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 OpenShiftClusterDocumentClient
- type OpenShiftClusterDocumentIterator
- type Options
- type Parameter
- type PartitionKey
- type PartitionKeyKind
- type PartitionKeyRange
- type PartitionKeyRangeStatus
- type PartitionKeyRanges
- type Query
- type SubscriptionDocumentClient
- type SubscriptionDocumentIterator
- 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 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(*Collection) (*Collection, error) List() CollectionIterator ListAll() (*Collections, error) Get(string) (*Collection, error) Delete(*Collection) error Replace(*Collection) (*Collection, error) PartitionKeyRanges(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() (*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(*Database) (*Database, error) List() DatabaseIterator ListAll() (*Databases, error) Get(string) (*Database, error) Delete(*Database) error }
DatabaseClient is a database client
func NewDatabaseClient ¶
func NewDatabaseClient(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 OpenShiftClusterDocumentClient ¶
type OpenShiftClusterDocumentClient interface { Create(string, *pkg.OpenShiftClusterDocument, *Options) (*pkg.OpenShiftClusterDocument, error) List() OpenShiftClusterDocumentIterator ListAll() (*pkg.OpenShiftClusterDocuments, error) Get(string, string) (*pkg.OpenShiftClusterDocument, error) Replace(string, *pkg.OpenShiftClusterDocument, *Options) (*pkg.OpenShiftClusterDocument, error) Delete(string, *pkg.OpenShiftClusterDocument, *Options) error Query(string, *Query) OpenShiftClusterDocumentIterator QueryAll(string, *Query) (*pkg.OpenShiftClusterDocuments, error) }
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() (*pkg.OpenShiftClusterDocuments, error)
}
OpenShiftClusterDocumentIterator is a openShiftClusterDocument iterator
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(string, *pkg.SubscriptionDocument, *Options) (*pkg.SubscriptionDocument, error) List() SubscriptionDocumentIterator ListAll() (*pkg.SubscriptionDocuments, error) Get(string, string) (*pkg.SubscriptionDocument, error) Replace(string, *pkg.SubscriptionDocument, *Options) (*pkg.SubscriptionDocument, error) Delete(string, *pkg.SubscriptionDocument, *Options) error Query(string, *Query) SubscriptionDocumentIterator QueryAll(string, *Query) (*pkg.SubscriptionDocuments, error) }
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() (*pkg.SubscriptionDocuments, error)
}
SubscriptionDocumentIterator is a subscriptionDocument 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(*Trigger) (*Trigger, error) List() TriggerIterator ListAll() (*Triggers, error) Get(string) (*Trigger, error) Delete(*Trigger) error Replace(*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