Files
ent/entc/gen/template/dialect/gremlin/open.tmpl
Alex Snast ac50ea81d4 ent: address several lint errors throughout the project (#1534)
Summary:
Pull Request resolved: https://github.com/facebookexternal/fbc/pull/1534

Pull Request resolved: https://github.com/facebookincubator/ent/pull/73

lint errors detected by running `golangci-lint` tool.

Reviewed By: a8m

Differential Revision: D17784980

fbshipit-source-id: f7e8bd99fdf1e018d5672cea1e8d44b67f2a4201
2019-10-06 23:59:12 -07:00

23 lines
542 B
Cheetah

{{/*
Copyright 2019-present Facebook Inc. All rights reserved.
This source code is licensed under the Apache 2.0 license found
in the LICENSE file in the root directory of this source tree.
*/}}
{{ define "dialect/gremlin/client/open" }}
u, err := url.Parse(dataSourceName)
if err != nil {
return nil, err
}
c, err := gremlin.NewClient(gremlin.Config{
Endpoint: gremlin.Endpoint{
URL: u,
},
})
if err != nil {
return nil, err
}
drv := gremlin.NewDriver(c)
return NewClient(append(options, Driver(drv))...), nil
{{ end }}