Add auth credentials to the given urls, since CBGT cannot take auth handlers in certain API calls yet
(urls []string, spec BucketSpec)
| 863 | |
| 864 | // Add auth credentials to the given urls, since CBGT cannot take auth handlers in certain API calls yet |
| 865 | func 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 |
| 884 | func StringPrefix(s string, desiredSize int) string { |
nothing calls this directly
no test coverage detected