graph

package
v0.4.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ErrMissingID = errors.Error("missing id")
	ErrInternal  = errors.Error("internal error")
	ErrExists    = errors.Error("already exists")
	ErrNotFound  = errors.Error("not found")
)

Variables

This section is empty.

Functions

func Dot

func Dot(objects []object.Object) (string, error)

Dot returns a graphviz representation of a graph

Types

type Graph added in v0.4.2

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

Graph object store

func (*Graph) Dump added in v0.4.2

func (s *Graph) Dump() ([]object.Object, error)

Dump returns all objects

func (*Graph) Get added in v0.4.2

func (s *Graph) Get(hash string) (object.Object, error)

Get returns an object given its hash

func (*Graph) Graph added in v0.4.2

func (s *Graph) Graph(hash string) ([]object.Object, error)

Graph returns all objects in a graph given the hash of of its objects

func (*Graph) Heads added in v0.4.2

func (s *Graph) Heads() ([]object.Object, error)

Heads returns all the objects that do not have any parents

func (*Graph) Put added in v0.4.2

func (s *Graph) Put(v object.Object) error

Put an object in the store

type Store

type Store interface {
	Put(object.Object) error
	Get(string) (object.Object, error)
	Graph(string) ([]object.Object, error)
	Heads() ([]object.Object, error)
}

Store interface

func New added in v0.4.2

func New(store kv.Store) Store

New constructs a new graph store using a kv backend

Jump to

Keyboard shortcuts

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