models

package
v0.0.0-...-0a741b5 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadSchema

func LoadSchema(db *dgo.Dgraph)

LoadSchema makes sure the DGraph schema is loaded into the database on starting

Types

type ContentNode

type ContentNode struct {

	// title
	Title string `json:"title,omitempty"`

	// body
	Body string `json:"body,omitempty"`

	// children
	// Required: true
	Children []*ContentNode `json:"~parent,omitempty"`

	// created
	// Required: true
	Created time.Time `json:"created,omitempty"`
	// edited
	// Required: true
	Edited time.Time `json:"edited,omitempty"`

	// image Uri
	ImageURI *url.URL `json:"imageUri,omitempty"`

	// score
	// Required: true
	Score float64 `json:"score,omitempty"`

	// sentiment
	// Required: true
	Sentiment float64 `json:"sentiment,omitempty"`

	// tags
	Tags []Tag `json:"tags,omitempty"`

	// type
	DgraphType []string `json:"dgraph.type,omitempty"`

	// uid
	UID string `json:"uid,omitempty"`
}

ContentNode content node

type Edge

type Edge struct {
	UID string `json:"uid"`
}

Edge handles the fact that DGraph expects edges to be sub objects, not fields

type Invite

type Invite struct {

	// code
	Code string `json:"code,omitempty"`

	// created by
	CreatedBy *User `json:"createdBy,omitempty"`

	// uid
	UID *string `json:"uid,omitempty"`

	// type
	DgraphType []string `json:"dgraph.type,omitempty"`
}

Invite invite swagger:model Invite

type NewContentNodeNode

type NewContentNodeNode struct {
	ContentNode
	ParentUID *Edge `json:"parent,omitempty"`
}

NewContentNodeNode is a struct designed to handle special parameters for creating a node in DGraph

type Role

type Role struct {

	// text
	// Required: true
	Text string `json:"text,omitempty"`

	// uid
	UID *string `json:"uid,omitempty"`

	// type
	DgraphType []string `json:"dgraph.type,omitempty"`
}

Role role

type Tag

type Tag struct {

	// text
	// Required: true
	Text string `json:"text,omitempty"`

	// uid
	UID string `json:"uid,omitempty"`
}

Tag tag

type User

type User struct {

	// avi img Uri
	AviImgURI *string `json:"aviImgUri,omitempty"`

	// commented
	Posted []ContentNode `json:"~author,omitempty"`

	// email
	// Required: true
	Email string `json:"email,omitempty"`

	// invited by
	InvitedBy []*User `json:"invitedBy,omitempty"`

	// joined
	// Required: true
	Joined *time.Time `json:"joined,omitempty"`

	// name
	// Required: true
	Name string `json:"name,omitempty"`

	// reputation
	// Required: true
	Reputation float64 `json:"reputation,omitempty"`

	// role
	// Required: true
	Role []*Role `json:"role,omitempty"`

	// spent
	Spent float64 `json:"spent,omitempty"`

	// uid
	UID *string `json:"uid,omitempty"`

	// type
	DgraphType []string `json:"dgraph.type,omitempty"`
}

Jump to

Keyboard shortcuts

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