graph database for pehpeh
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

преди 1 година
1234567891011121314151617181920212223242526272829303132333435363738
  1. package graph
  2. import (
  3. "github.com/cayleygraph/cayley"
  4. cg "github.com/cayleygraph/cayley/graph"
  5. )
  6. type Server interface {
  7. Run()
  8. }
  9. func NewServer() Server {
  10. return &server{
  11. backend: "bolt",
  12. }
  13. }
  14. type server struct {
  15. path string
  16. backend string
  17. store *cayley.Handle
  18. }
  19. func (srv *server) open() error {
  20. cg.InitQuadStore(srv.backend, srv.path, nil)
  21. store, err := cayley.NewGraph(srv.backend, srv.path, nil)
  22. if err != nil {
  23. return err
  24. }
  25. srv.store = store
  26. return nil
  27. }
  28. func (srv *server) Run() {
  29. // noop
  30. }