removed dgraph
This commit is contained in:
parent
4a285e8c52
commit
3df1ae5f59
@ -1,79 +0,0 @@
|
||||
package dgraph
|
||||
|
||||
import (
|
||||
"context"
|
||||
"e621_to_neo4j/database"
|
||||
"e621_to_neo4j/e621/models"
|
||||
"github.com/dgraph-io/dgo/v210"
|
||||
"github.com/dgraph-io/dgo/v210/protos/api"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
"google.golang.org/grpc/encoding/gzip"
|
||||
"log"
|
||||
)
|
||||
|
||||
type dgraphConnection struct {
|
||||
driver dgo.Dgraph
|
||||
}
|
||||
|
||||
func (d *dgraphConnection) UploadUser(ctx context.Context, user models.E621User) error {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (d *dgraphConnection) UploadSource(ctx context.Context, SourceURL string) error {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (d *dgraphConnection) UploadPost(ctx context.Context, e621ID int64) error {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (d *dgraphConnection) UploadTag(ctx context.Context, name string, tagType string) error {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (d *dgraphConnection) EstablishPostTagLink(ctx context.Context, e621PostID int64, e621Tag string) error {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (d *dgraphConnection) EstablishPostToSourceLink(ctx context.Context, e621PostID int64, sourceURL string) error {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (d *dgraphConnection) EstablishUserToPostLink(ctx context.Context, e621PostID int64, e621UserID int64) error {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (d *dgraphConnection) Connect(ctx context.Context, endpoint string, username string, password string) error {
|
||||
// Dial a gRPC connection. The address to dial to can be configured when
|
||||
// setting up the dgraph cluster.
|
||||
dialOpts := append([]grpc.DialOption{},
|
||||
grpc.WithTransportCredentials(insecure.NewCredentials()),
|
||||
grpc.WithDefaultCallOptions(grpc.UseCompressor(gzip.Name)))
|
||||
conn, err := grpc.Dial(endpoint, dialOpts...)
|
||||
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
defer func(conn *grpc.ClientConn) {
|
||||
err := conn.Close()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}(conn)
|
||||
|
||||
d.driver = *dgo.NewDgraphClient(api.NewDgraphClient(conn))
|
||||
return nil
|
||||
}
|
||||
|
||||
func NewDGraphConnection() database.GraphConnection {
|
||||
return &dgraphConnection{}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
version: "3.2"
|
||||
services:
|
||||
zero:
|
||||
image: dgraph/dgraph:latest
|
||||
ports:
|
||||
- 5080:5080
|
||||
- 6080:6080
|
||||
restart: on-failure
|
||||
command: dgraph zero --my=zero:5080
|
||||
alpha:
|
||||
image: dgraph/dgraph:latest
|
||||
ports:
|
||||
- 8080:8080
|
||||
- 9080:9080
|
||||
restart: on-failure
|
||||
command: dgraph alpha --my=alpha:7080 --zero=zero:5080 --security whitelist=<IP_ADDRESS>
|
||||
ratel:
|
||||
image: dgraph/ratel:latest
|
||||
ports:
|
||||
- 8000:8000
|
Reference in New Issue
Block a user