Exemplo n.º 1
0
func NewGremlinBackend(addr string, port int) (*GremlinBackend, error) {
	c := gremlin.NewClient(addr, port)
	c.Connect()

	return &GremlinBackend{
		client: c,
	}, nil
}
Exemplo n.º 2
0
func NewGremlinBackend(endpoint string) (*GremlinBackend, error) {
	c, err := gremlin.NewClient(endpoint)
	if err != nil {
		return nil, err
	}
	if err = c.Connect(); err != nil {
		return nil, err
	}

	logging.GetLogger().Infof("Connected to gremlin server %s", endpoint)

	return &GremlinBackend{
		client: c,
	}, nil
}