graphsession

package
v0.18.5-beta Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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