-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
Motivation ---------- Transactions operations receive a collection from the user, however due to us building gocbtransactions on top of gocbcore transactions we don't actually route requests through the collection. Instead we need to get the gocbcore agent that the collection is using. Changes ------- Create a BucketInternal type accessible via Bucket. Add an internal IORouter function to BucketInternal. Add a function to get Bucket from Collection. Change-Id: Ife038540921ae8e1039253ef43b9b025c5c398a5 Reviewed-on: http://review.couchbase.org/c/gocb/+/132630 Reviewed-by: Brett Lawson <brett19@gmail.com> Tested-by: Charles Dixon <chvckd@gmail.com>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package gocb | ||
|
||
import gocbcore "github.com/couchbase/gocbcore/v9" | ||
|
||
// InternalBucket is used for internal functionality. | ||
// Internal: This should never be used and is not supported. | ||
type InternalBucket struct { | ||
bucket *Bucket | ||
} | ||
|
||
// Internal returns a CollectionInternal. | ||
// Internal: This should never be used and is not supported. | ||
func (b *Bucket) Internal() *InternalBucket { | ||
return &InternalBucket{bucket: b} | ||
} | ||
|
||
// IORouter returns the collection's internal core router. | ||
func (ib *InternalBucket) IORouter() (*gocbcore.Agent, error) { | ||
return ib.bucket.connectionManager.connection(ib.bucket.Name()) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.