@@ -323,3 +323,75 @@ type CollectionShards struct {
323323 // Available from 3.6 ArangoDB version.
324324 WriteConcern int `json:"writeConcern,omitempty"`
325325}
326+
327+ type collectionShardsInternal struct {
328+ CollectionInfo
329+
330+ // CacheEnabled set cacheEnabled option in collection properties
331+ CacheEnabled bool `json:"cacheEnabled,omitempty"`
332+
333+ // Set to create a smart edge or vertex collection.
334+ // This requires ArangoDB Enterprise Edition.
335+ IsSmart bool `json:"isSmart,omitempty"`
336+
337+ KeyOptions struct {
338+ // Type specifies the type of the key generator. The currently available generators are traditional and autoincrement.
339+ Type KeyGeneratorType `json:"type,omitempty"`
340+ // AllowUserKeys; if set to true, then it is allowed to supply own key values in the _key attribute of a document.
341+ // If set to false, then the key generator is solely responsible for generating keys and supplying own key values in
342+ // the _key attribute of documents is considered an error.
343+ AllowUserKeys bool `json:"allowUserKeys,omitempty"`
344+ } `json:"keyOptions,omitempty"`
345+
346+ // Deprecated: use 'WriteConcern' instead.
347+ MinReplicationFactor int `json:"minReplicationFactor,omitempty"`
348+
349+ // NumberOfShards is the number of shards of the collection.
350+ // Only available in cluster setup.
351+ NumberOfShards int `json:"numberOfShards,omitempty"`
352+
353+ // This attribute specifies the name of the sharding strategy to use for the collection.
354+ // Can not be changed after creation.
355+ ShardingStrategy ShardingStrategy `json:"shardingStrategy,omitempty"`
356+
357+ // ShardKeys contains the names of document attributes that are used to determine the target shard for documents.
358+ // Only available in cluster setup.
359+ ShardKeys []string `json:"shardKeys,omitempty"`
360+
361+ // Shards is a list of shards that belong to the collection.
362+ // Each shard contains a list of DB servers where the first one is the leader and the rest are followers.
363+ Shards map [ShardID ][]ServerID `json:"shards,omitempty"`
364+
365+ // StatusString represents status as a string.
366+ StatusString string `json:"statusString,omitempty"`
367+
368+ // ReplicationFactor contains how many copies of each shard are kept on different DBServers.
369+ // Only available in cluster setup.
370+ ReplicationFactor replicationFactor `json:"replicationFactor,omitempty"`
371+
372+ // WaitForSync; If true then creating, changing or removing documents will wait
373+ // until the data has been synchronized to disk.
374+ WaitForSync bool `json:"waitForSync,omitempty"`
375+
376+ // WriteConcern contains how many copies must be available before a collection can be written.
377+ // It is required that 1 <= WriteConcern <= ReplicationFactor.
378+ // Default is 1. Not available for satellite collections.
379+ // Available from 3.6 ArangoDB version.
380+ WriteConcern int `json:"writeConcern,omitempty"`
381+ }
382+
383+ func (p * CollectionShards ) fromInternal (i collectionShardsInternal ) {
384+ p .CollectionInfo = i .CollectionInfo
385+ p .CacheEnabled = i .CacheEnabled
386+ p .IsSmart = i .IsSmart
387+ p .KeyOptions = i .KeyOptions
388+ p .MinReplicationFactor = i .MinReplicationFactor
389+ p .NumberOfShards = i .NumberOfShards
390+ p .ShardingStrategy = i .ShardingStrategy
391+ p .ShardKeys = i .ShardKeys
392+ p .Shards = i .Shards
393+ p .StatusString = i .StatusString
394+ p .ReplicationFactor = int (i .ReplicationFactor )
395+ p .WaitForSync = i .WaitForSync
396+ p .WriteConcern = i .WriteConcern
397+ }
0 commit comments