Skip to content

ryanmoran/libgenders

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Libgenders

An implementation of libgenders in Go.

Usage

package main

import (
	"fmt"
	"log"

	"github.com/ryanmoran/libgenders"
)

func main() {
	database, err := libgenders.NewDatabase(libgenders.DefaultGendersFilepath)
	if err != nil {
		log.Fatal(err)
	}

	value, ok := database.GetNodeAttr("node1", "attr2")
	if ok {
		fmt.Println(value)
	}

	nodes, err := database.Query("~(attr1 -- ((attr1 && attr3) || (attr1 && attr5)))")
	if err != nil {
		log.Fatal(err)
	}

	for _, node := range nodes {
		fmt.Printf("name: %s, attributes: %v\n", node.Name, node.Attributes)
	}
}

About

Go implementation of libgenders

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages