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

Function SafeDatabaseName

rest/utilities_testing.go:2784–2790  ·  view source on GitHub ↗

SafeDatabaseName returns a database name free of any special characters for use in tests.

(t *testing.T, name string)

Source from the content-addressed store, hash-verified

2782
2783// SafeDatabaseName returns a database name free of any special characters for use in tests.
2784func SafeDatabaseName(t *testing.T, name string) string {
2785 dbName := strings.ToLower(name)
2786 for _, c := range []string{" ", "<", ">", "/", "="} {
2787 dbName = strings.ReplaceAll(dbName, c, "_")
2788 }
2789 return dbName
2790}
2791
2792// SafeDocumentName returns a document name free of any special characters for use in tests.
2793func SafeDocumentName(t *testing.T, name string) string {

Callers 3

newSyncGatewayPeerFunction · 0.92

Calls

no outgoing calls

Tested by 3

newSyncGatewayPeerFunction · 0.74