2024-02-12 19:38:03 +00:00
|
|
|
package repositorymodels
|
|
|
|
|
|
|
|
type Database struct {
|
2024-02-26 19:03:47 +00:00
|
|
|
ID string `json:"id"`
|
|
|
|
TimeStamp int64 `json:"_ts"`
|
|
|
|
ResourceID string `json:"_rid"`
|
|
|
|
ETag string `json:"_etag"`
|
|
|
|
Self string `json:"_self"`
|
2024-02-12 19:38:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type RepositoryStatus int
|
|
|
|
|
|
|
|
const (
|
|
|
|
StatusOk = 1
|
|
|
|
StatusNotFound = 2
|
|
|
|
Conflict = 3
|
|
|
|
BadRequest = 4
|
|
|
|
)
|
|
|
|
|
|
|
|
type Collection struct {
|
|
|
|
ID string `json:"id"`
|
|
|
|
IndexingPolicy CollectionIndexingPolicy `json:"indexingPolicy"`
|
|
|
|
PartitionKey CollectionPartitionKey `json:"partitionKey"`
|
2024-02-26 19:03:47 +00:00
|
|
|
ResourceID string `json:"_rid"`
|
2024-02-24 18:00:47 +00:00
|
|
|
TimeStamp int64 `json:"_ts"`
|
2024-02-12 19:38:03 +00:00
|
|
|
Self string `json:"_self"`
|
2024-02-24 18:00:47 +00:00
|
|
|
ETag string `json:"_etag"`
|
2024-02-12 19:38:03 +00:00
|
|
|
Docs string `json:"_docs"`
|
|
|
|
Sprocs string `json:"_sprocs"`
|
|
|
|
Triggers string `json:"_triggers"`
|
|
|
|
Udfs string `json:"_udfs"`
|
|
|
|
Conflicts string `json:"_conflicts"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type CollectionIndexingPolicy struct {
|
|
|
|
IndexingMode string `json:"indexingMode"`
|
|
|
|
Automatic bool `json:"automatic"`
|
|
|
|
IncludedPaths []CollectionIndexingPolicyPath `json:"includedPaths"`
|
|
|
|
ExcludedPaths []CollectionIndexingPolicyPath `json:"excludedPaths"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type CollectionIndexingPolicyPath struct {
|
|
|
|
Path string `json:"path"`
|
|
|
|
Indexes []struct {
|
|
|
|
Kind string `json:"kind"`
|
|
|
|
DataType string `json:"dataType"`
|
|
|
|
Precision int `json:"precision"`
|
|
|
|
} `json:"indexes"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type CollectionPartitionKey struct {
|
|
|
|
Paths []string `json:"paths"`
|
|
|
|
Kind string `json:"kind"`
|
|
|
|
Version int `json:"Version"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type UserDefinedFunction struct {
|
2024-02-26 19:03:47 +00:00
|
|
|
Body string `json:"body"`
|
|
|
|
ID string `json:"id"`
|
|
|
|
ResourceID string `json:"_rid"`
|
|
|
|
TimeStamp int `json:"_ts"`
|
|
|
|
Self string `json:"_self"`
|
|
|
|
Etag string `json:"_etag"`
|
2024-02-12 19:38:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type StoredProcedure struct {
|
2024-02-26 19:03:47 +00:00
|
|
|
Body string `json:"body"`
|
|
|
|
ID string `json:"id"`
|
|
|
|
ResourceID string `json:"_rid"`
|
|
|
|
TimeStamp int `json:"_ts"`
|
|
|
|
Self string `json:"_self"`
|
|
|
|
Etag string `json:"_etag"`
|
2024-02-12 19:38:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Trigger struct {
|
|
|
|
Body string `json:"body"`
|
|
|
|
ID string `json:"id"`
|
|
|
|
TriggerOperation string `json:"triggerOperation"`
|
|
|
|
TriggerType string `json:"triggerType"`
|
2024-02-26 19:03:47 +00:00
|
|
|
ResourceID string `json:"_rid"`
|
|
|
|
TimeStamp int `json:"_ts"`
|
2024-02-12 19:38:03 +00:00
|
|
|
Self string `json:"_self"`
|
|
|
|
Etag string `json:"_etag"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type Document map[string]interface{}
|
|
|
|
|
|
|
|
type PartitionKeyRange struct {
|
2024-02-26 19:03:47 +00:00
|
|
|
ResourceID string `json:"_rid"`
|
2024-02-12 19:38:03 +00:00
|
|
|
ID string `json:"id"`
|
|
|
|
Etag string `json:"_etag"`
|
|
|
|
MinInclusive string `json:"minInclusive"`
|
|
|
|
MaxExclusive string `json:"maxExclusive"`
|
|
|
|
RidPrefix int `json:"ridPrefix"`
|
|
|
|
Self string `json:"_self"`
|
|
|
|
ThroughputFraction int `json:"throughputFraction"`
|
|
|
|
Status string `json:"status"`
|
|
|
|
Parents []any `json:"parents"`
|
2024-02-26 19:03:47 +00:00
|
|
|
TimeStamp int64 `json:"_ts"`
|
2024-02-12 19:38:03 +00:00
|
|
|
Lsn int `json:"lsn"`
|
|
|
|
}
|
2024-02-14 18:46:40 +00:00
|
|
|
|
|
|
|
type State struct {
|
2024-02-25 20:13:04 +00:00
|
|
|
// Map databaseId -> Database
|
|
|
|
Databases map[string]Database `json:"databases"`
|
|
|
|
|
|
|
|
// Map databaseId -> collectionId -> Collection
|
|
|
|
Collections map[string]map[string]Collection `json:"collections"`
|
|
|
|
|
|
|
|
// Map databaseId -> collectionId -> documentId -> Documents
|
|
|
|
Documents map[string]map[string]map[string]Document `json:"documents"`
|
2024-02-14 18:46:40 +00:00
|
|
|
}
|