relationship

package
v0.0.0-...-df4f15f Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	DB         *dgo.Dgraph
	Connection []*grpc.ClientConn
}

Store holds dgraph client and connections

func (*Store) CheckOrCreatePredicate

func (store *Store) CheckOrCreatePredicate(ctx *context.Context, parentUid string, childUid string) (exists bool, err error)

CheckOrCreatePredicate function checks for edge, creates if doesn't exist.

func (*Store) CheckPredicate

func (store *Store) CheckPredicate(ctx *context.Context, parentUid string, childUid string) (exists bool, err error)

CheckPredicate function checks to see if edge exists

func (*Store) Connect

func (store *Store) Connect()

Connect function initiates connections to database

func (*Store) DeleteAll

func (store *Store) DeleteAll() (err error)

DeleteAll function deletes all data in database

func (*Store) FindNode

func (store *Store) FindNode(ctx *context.Context, Url string, depth int) (currentPage *page.Page, err error)

FindNode function finds Page by URL and depth

func (*Store) FindOrCreateNode

func (store *Store) FindOrCreateNode(ctx *context.Context, currentPage *page.Page) (uid string, err error)

FindOrCreateNode function checks for page, creates if doesn't exist.F

func (*Store) SetSchema

func (store *Store) SetSchema() (err error)

SetSchema function sets the schema for dgraph (mainly for tests)

Jump to

Keyboard shortcuts

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