MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / cmd

Method cmd

dgraphtest/dgraph.go:245–314  ·  view source on GitHub ↗
(c *LocalCluster)

Source from the content-addressed store, hash-verified

243}
244
245func (a *alpha) cmd(c *LocalCluster) []string {
246 acmd := []string{buildvars.GoBinDgraphPath.Get(), "alpha", fmt.Sprintf("--my=%s:%v", a.aname(), alphaInterPort),
247 "--bindall", "--logtostderr", fmt.Sprintf("-v=%d", c.conf.verbosity)}
248
249 if c.lowerThanV21 {
250 acmd = append(acmd, `--whitelist=0.0.0.0/0`, "--telemetry=false")
251 } else {
252 security := `--security=whitelist=0.0.0.0/0`
253 if c.conf.securityToken != "" {
254 security += fmt.Sprintf(`;token=%s`, c.conf.securityToken)
255 }
256 acmd = append(acmd, security, "--telemetry=reports=false;")
257 }
258
259 if c.conf.lambdaURL != "" {
260 acmd = append(acmd, fmt.Sprintf(`--graphql=lambda-url=%s`, c.conf.lambdaURL))
261 }
262
263 if c.conf.acl {
264 if c.lowerThanV21 {
265 acmd = append(acmd, fmt.Sprintf(`--acl_secret_file=%s`, aclSecretMountPath),
266 fmt.Sprintf(`--acl_access_ttl=%s`, c.conf.aclTTL))
267 } else {
268 aclPart := "--acl="
269 if c.conf.aclTTL > 0 {
270 aclPart += fmt.Sprintf(`secret-file=%s;access-ttl=%s;`, aclSecretMountPath, c.conf.aclTTL)
271 }
272 if c.conf.aclAlg != nil {
273 aclPart += fmt.Sprintf(`jwt-alg=%s`, c.conf.aclAlg.Alg())
274 }
275 acmd = append(acmd, aclPart)
276 }
277 }
278 if c.conf.encryption {
279 if c.lowerThanV21 {
280 acmd = append(acmd, fmt.Sprintf(`--encryption_key_file=%v`, encKeyMountPath))
281 } else {
282 acmd = append(acmd, fmt.Sprintf(`--encryption=key-file=%v`, encKeyMountPath))
283 }
284 }
285
286 zeroAddrsArg, delimiter := "--zero=", ""
287 for _, zo := range c.zeros {
288 zeroAddrsArg += fmt.Sprintf("%s%v:%v", delimiter, zo.aname(), zeroGrpcPort)
289 delimiter = ","
290 }
291 acmd = append(acmd, zeroAddrsArg)
292
293 if len(c.conf.featureFlags) > 0 {
294 acmd = append(acmd, fmt.Sprintf("--feature-flags=%v", strings.Join(c.conf.featureFlags, ";")))
295 }
296
297 if c.conf.customPlugins {
298 acmd = append(acmd, fmt.Sprintf("--custom_tokenizers=%s", c.customTokenizers))
299 }
300
301 if c.conf.snapShotAfterEntries != 0 {
302 acmd = append(acmd, fmt.Sprintf("--raft=%s",

Callers

nothing calls this directly

Calls 3

anameMethod · 0.95
GetMethod · 0.65
anameMethod · 0.65

Tested by

no test coverage detected