MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / ServerUrlsWithAuth

Function ServerUrlsWithAuth

base/util.go:865–881  ·  view source on GitHub ↗

Add auth credentials to the given urls, since CBGT cannot take auth handlers in certain API calls yet

(urls []string, spec BucketSpec)

Source from the content-addressed store, hash-verified

863
864// Add auth credentials to the given urls, since CBGT cannot take auth handlers in certain API calls yet
865func ServerUrlsWithAuth(urls []string, spec BucketSpec) (urlsWithAuth []string, err error) {
866 urlsWithAuth = make([]string, len(urls))
867 username, password, bucketName := spec.Auth.GetCredentials()
868 for i, url := range urls {
869 urlWithAuth, err := CouchbaseUrlWithAuth(
870 url,
871 username,
872 password,
873 bucketName,
874 )
875 if err != nil {
876 return urlsWithAuth, err
877 }
878 urlsWithAuth[i] = urlWithAuth
879 }
880 return urlsWithAuth, nil
881}
882
883// Slice a string to be less than or equal to desiredSze
884func StringPrefix(s string, desiredSize int) string {

Callers

nothing calls this directly

Calls 2

CouchbaseUrlWithAuthFunction · 0.85
GetCredentialsMethod · 0.65

Tested by

no test coverage detected