util

package
v0.0.0-...-93cb1e8 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: MIT Imports: 23 Imported by: 1

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(<-chan *gdbi.Vertex, int) error, edgeAdd func(<-chan *gdbi.Edge, int) 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 of JSON edges and streams *gripql.Edge objects.

func StreamLines

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

StreamLines returns a channel of lines from a file.

func StreamRawJsonFromFile

func StreamRawJsonFromFile(file string, workers int, graph string, extra_args map[string]any) (chan *gripql.RawJson, error)

func StreamVerticesFromFile

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

StreamVerticesFromFile reads a file of JSON vertices and streams *gripql.Vertex objects.

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