getClientWithAdminCtx creates a client by checking the --alpha, various --tls*, and --retries options, and then login using groot id and password
(conf *viper.Viper)
| 157 | // getClientWithAdminCtx creates a client by checking the --alpha, various --tls*, and --retries |
| 158 | // options, and then login using groot id and password |
| 159 | func getClientWithAdminCtx(conf *viper.Viper) (*dgo.Dgraph, x.CloseFunc, error) { |
| 160 | dg, closeClient := x.GetDgraphClient(conf, false) |
| 161 | creds := z.NewSuperFlag(conf.GetString("guardian-creds")) |
| 162 | err := x.GetPassAndLogin(dg, &x.CredOpt{ |
| 163 | UserID: creds.GetString("user"), |
| 164 | Password: creds.GetString("password"), |
| 165 | Namespace: creds.GetUint64("namespace"), |
| 166 | }) |
| 167 | if err != nil { |
| 168 | return nil, nil, err |
| 169 | } |
| 170 | return dg, closeClient, nil |
| 171 | } |
| 172 | |
| 173 | // CreateUserNQuads creates the NQuads needed to store a user with the given ID and |
| 174 | // password in the ACL system. |
no test coverage detected