graphsession

package
v0.18.3-beta.rc3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGraphSessionFactory

func NewGraphSessionFactory(graph ReadOnlyGraph) routing.GraphSessionFactory

NewGraphSessionFactory constructs a new Factory which can then be used to start a new session.

func NewRoutingGraph

func NewRoutingGraph(graph ReadOnlyGraph) routing.Graph

NewRoutingGraph constructs a session that which does not first start a read-only transaction and so each call on the routing.Graph will create a new transaction.

Types

type Factory

type Factory struct {
	// contains filtered or unexported fields
}

Factory implements the routing.GraphSessionFactory and can be used to start a session with a ReadOnlyGraph.

func (*Factory) NewGraphSession

func (g *Factory) NewGraphSession() (routing.Graph, func() error, error)

NewGraphSession will produce a new Graph to use for a path-finding session. It returns the Graph along with a call-back that must be called once Graph access is complete. This call-back will close any read-only transaction that was created at Graph construction time.

NOTE: This is part of the routing.GraphSessionFactory interface.

type ReadOnlyGraph

type ReadOnlyGraph interface {
	// NewPathFindTx returns a new read transaction that can be used for a
	// single path finding session. Will return nil if the graph cache is
	// enabled.
	NewPathFindTx() (kvdb.RTx, error)
	// contains filtered or unexported methods
}

ReadOnlyGraph is a graph extended with a call to create a new read-only transaction that can then be used to make further queries to the graph.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL