util

package
v0.0.0-...-fa720cf Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 21 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPostgresConnStr

func BuildPostgresConnStr(host string, port uint, user, password, dbname, sslmode string) (string, error)

func CreatePostgresDatabase

func CreatePostgresDatabase(host string, port uint, user, password, dbname, sslmode string) error

CreatePosgresDatabase creates a postgres database

func DirScan

func DirScan(baseDir string, fileGlob string) ([]string, error)

func MergeMaps

func MergeMaps(x1, x2 interface{}) interface{}

MergeMaps deeply merges two schema maps

func RandomPort

func RandomPort() string

RandomPort returns a random port string between 10000 and 20000.

func RandomString

func RandomString(n int) string

RandomString generates a random string of length n.

func StreamBatch

func StreamBatch(stream <-chan *gdbi.GraphElement, batchSize int, graph string, vertexAdd func([]*gdbi.Vertex) error, edgeAdd func([]*gdbi.Edge) error) error

StreamBatch a stream of inputs and loads them into the graph This function assumes incoming stream is GraphElemnts from a single graph

func StreamEdgesFromFile

func StreamEdgesFromFile(file string, workers int) (chan *gripql.Edge, error)

StreamEdgesFromFile reads a file containing an edge per line and streams gripql.Edge objects on a channel

func StreamLines

func StreamLines(file string, chanSize int) (chan string, error)

StreamLines returns a channel of lines from a file.

func StreamVerticesFromFile

func StreamVerticesFromFile(file string, workers int) (chan *gripql.Vertex, error)

StreamVerticesFromFile reads a file containing a vertex per line and streams *gripql.Vertex objects out on a channel

func UUID

func UUID() string

UUID generates a k-sortable globally unique ID.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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