Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplySchema ¶
func ApplySchema() bool
ApplySchema creates the schema in the database based on the model classes
func VerifySchema ¶
VerifySchema checks to see if the database schema matches the model objects
Types ¶
type Novel ¶
type Novel struct { DType []string `json:"dgraph.type,omitempty" tokenizer:"exact"` Name string `json:"name,omitempty"` UUID string `json:"uuid,omitempty" tokenizer:"hash"` NumChapters int `json:"num-chapters,omitempty"` Since *time.Time `json:"since,omitempty"` LastTurn *time.Time `json:"last-turn,omitempty"` Done bool `json:"done,omitempty"` Picture string `json:"picture,omitempty"` Public bool `json:"public,omitempty"` TurnMin int `json:"turn-min,omitempty"` TurnMax int `json:"turn-max,omitempty"` TurnType int `json:"turn-type,omitempty"` }
Novel node type
type Permission ¶
type Permission struct { DType []string `json:"dgraph.type,omitempty" tokenizer:"exact"` Name string `json:"name,omitempty"` }
Permission node type
type Predicate ¶
type Predicate struct { Name string `json:"predicate,omitempty"` Type string `json:"type,omitempty"` IsIndex bool `json:"index,omitempty"` IsList bool `json:"list,omitempty"` HasReverse bool `json:"reverse,omitempty"` Tokenizer []string `json:"tokenizer,omitempty"` }
Predicate from schema
type Role ¶
type Role struct { DType []string `json:"dgraph.type,omitempty" tokenizer:"exact"` Name string `json:"name,omitempty"` Permissions []Permission `json:"perms,omitempty"` // value interface{} }
Role node type
type SchemaData ¶
type SchemaData struct { Schema []Predicate `json:"schema,omitempty"` Types []Type `json:"types,omitempty"` }
SchemaData from schema response
type Token ¶
type Token struct { DType []string `json:"dgraph.type,omitempty" tokenizer:"exact"` Token string `json:"token,omitempty" tokenizer:"hash"` Since *time.Time `json:"since,omitempty"` Until *time.Time `json:"until,omitempty"` User []User `json:"user,omitempty" reverse:"true"` }
Token node type
type User ¶
type User struct { DType []string `json:"dgraph.type,omitempty" tokenizer:"exact"` Username string `json:"username,omitempty" tokenizer:"hash"` UUID string `json:"uuid,omitempty" tokenizer:"hash"` Password string `json:"password,omitempty"` PasswordToken string `json:"password-token,omitempty" tokenizer:"hash"` Email string `json:"email,omitempty" tokenizer:"hash"` EmailToken string `json:"email-token,omitempty" tokenizer:"hash"` Phone string `json:"phone,omitempty" tokenizer:"hash"` PhoneToken string `json:"phone-token,omitempty" tokenizer:"hash"` Since *time.Time `json:"since,omitempty"` Picture string `json:"picture,omitempty"` Friends []User `json:"friends,omitempty"` // nickname string, since *time.Time Roles []Role `json:"roles,omitempty"` // priority int Novels []Novel `json:"novels,omitempty" reverse:"true"` // starred, notify bool, chapter, pos, turn int }
User node type
Click to show internal directories.
Click to hide internal directories.