MCPcopy Create free account
hub / github.com/temporalio/temporal / validateCQLClientConfig

Function validateCQLClientConfig

tools/cassandra/handler.go:208–229  ·  view source on GitHub ↗
(config *CQLClientConfig)

Source from the content-addressed store, hash-verified

206}
207
208func validateCQLClientConfig(config *CQLClientConfig) error {
209 if len(config.Hosts) == 0 {
210 return schema.NewConfigError("missing cassandra endpoint argument " + flag(schema.CLIOptEndpoint))
211 }
212 if config.Keyspace == "" {
213 return schema.NewConfigError("missing " + flag(schema.CLIOptKeyspace) + " argument ")
214 }
215 if config.Port == 0 {
216 config.Port = environment.GetCassandraPort()
217 }
218 if config.numReplicas == 0 {
219 config.numReplicas = defaultNumReplicas
220 }
221
222 if config.AddressTranslator != nil && len(config.AddressTranslator.Options) != 0 {
223 if len(config.AddressTranslator.Translator) == 0 {
224 return schema.NewConfigError("missing address translator argument " + flag(schema.CLIOptAddressTranslator))
225 }
226 }
227
228 return nil
229}
230
231func flag(opt string) string {
232 return "(-" + opt + ")"

Callers 2

newCQLClientConfigFunction · 0.85

Calls 3

NewConfigErrorFunction · 0.92
GetCassandraPortFunction · 0.92
flagFunction · 0.70

Tested by 1