Documentation
¶
Overview ¶
Package neo4j provides Neo4j graph client helpers.
New code should use the core-owned graph boundary:
import "github.com/InsideGallery/core/db/neo4j"
client, err := neo4j.NewGraphClient(ctx, neo4j.Options{Host: "neo4j://127.0.0.1:7687"})
Prefer Graph, Options, and Result in application-facing code so the Neo4j SDK driver type stays inside this adapter package.
Compatibility: Client and GetConnection remain available for existing SDK-shaped callers. Prefer NewGraphClient for new integrations.
Index ¶
Constants ¶
const ( TypeBasicAuth = "BasicAuth" TypeKerberosAuth = "KerberosAuth" TypeBearerAuth = "BearerAuth" )
const EnvPrefix = "NEO4J"
EnvPrefix environment prefix for gremlin config
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client
deprecated
type Client struct {
neo4j.DriverWithContext
// contains filtered or unexported fields
}
Client is the legacy Neo4j SDK-shaped client.
Deprecated: use GraphClient and core-owned option/result types for new code.
func GetConnection
deprecated
func GetConnection( ctx context.Context, cfg *ConnectionConfig, ) (*Client, error)
GetConnection creates the legacy Neo4j SDK-shaped client.
Deprecated: use NewGraphClient for new code.
type ConnectionConfig ¶
type ConnectionConfig struct {
Login string `env:"_LOGIN" envDefault:"neo4j"`
Password string `env:"_PASSWORD" envDefault:""`
Realm string `env:"_REALM" envDefault:""`
Ticket string `env:"_TICKET" envDefault:""`
Token string `env:"_TOKEN" envDefault:""`
Host string `env:"_HOST" envDefault:"neo4j://127.0.0.1:8080"`
TypeAuth string `env:"_AUTH" envDefault:"NoAuth"`
}
ConnectionConfig contains required data for gremlin
func GetConnectionConfigFromEnv ¶
func GetConnectionConfigFromEnv() (*ConnectionConfig, error)
GetConnectionConfigFromEnv return aerospike configs bases on environment variables
func (*ConnectionConfig) TokenManager ¶
func (c *ConnectionConfig) TokenManager(m auth.TokenManager) auth.TokenManager
type Graph ¶ added in v1.1.0
type Graph interface {
Verify(ctx context.Context) (Result, error)
Close(ctx context.Context) error
}
Graph is the core-owned Neo4j contract for new consumers.
type GraphClient ¶ added in v1.1.0
type GraphClient struct {
// contains filtered or unexported fields
}
GraphClient wraps the Neo4j driver behind core-owned operation inputs and results.
func NewGraphClient ¶ added in v1.1.0
func NewGraphClient(ctx context.Context, options Options) (*GraphClient, error)
NewGraphClient creates a Neo4j graph client from core-owned options.