db

package
v0.0.0-...-1607f05 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = fmt.Errorf("no matching record")

ErrNotFound indicates requested entity does not exist

Functions

This section is empty.

Types

type Database

type Database struct {
	Conn *grpc.ClientConn
	// contains filtered or unexported fields
}

func Initialize

func Initialize(addr string) (*Database, error)

func (Database) AddItem

func (db Database) AddItem(item *Item) error

func (Database) Get1000Items

func (db Database) Get1000Items() (*ItemList, error)

func (Database) GetItemById

func (db Database) GetItemById(itemId string) (Item, error)

type Item

type Item struct {
	UID         string     `json:"uid"`
	Type        []string   `json:"dgraph.type"`
	Name        string     `json:"name"`
	Description string     `json:"description"`
	CreatedAt   *time.Time `json:"createdAt"`
}

type ItemList

type ItemList struct {
	Items []Item `json:"items"`
}

Jump to

Keyboard shortcuts

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