dgraphland

package module
v0.0.0-...-171e089 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

README

dgraphland

Dgraphland is a Dgraph framework build on top of Dgo, the official Dgraph Go client which communicates with the server using gRPC.

DGRAPH

  • Download dgraph-windows-amd64.zip (Last Version)
  • Extract to ~/dgraph
  • cd ~/dgraph && ./dgraph.exe zero
  • cd ~/dgraph && ./dgraph.exe alpha --lru_mb 2048
  • cd ~/dgraph && ./dgraph-ratel.exe

Documentation

Index

Constants

View Source
const (
	TagDgland     = "dgland"
	TagJson       = "json"
	ModelTypeName = "Model"
)

Variables

View Source
var Client *dgo.Dgraph

Functions

func AutoMigrate

func AutoMigrate(models ...interface{}) error

AutoMigrate ใช้กำหนด Dgraph Schema อัตโนมัติ

func DropAll

func DropAll() error

DropAll ใช้ล้างข้อมูลใน Dgraph Database ทั้งหมด

func Schema

func Schema(models []interface{}) (string, error)

Types

type CancelFunc

type CancelFunc func()

func SetupClient

func SetupClient(target string) CancelFunc

SetupClient ใช้สำหรับการเชื่อมต่อฐานข้อมูล Dgraph ด้วย GRPC

type Model

type Model struct {
	Uid       string    `json:"uid,omitempty"`
	DType     []string  `json:"dgraph.type,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty" dgland:"string"`
	UpdatedAt time.Time `json:"updated_at,omitempty" dgland:"string"`
	DeletedAt time.Time `json:"deleted_at,omitempty" dgland:"string"`
}

Jump to

Keyboard shortcuts

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