Documentation ¶
Index ¶
- Constants
- func Hash256(input []byte) string
- type AUTO_INCREMENT
- type CHECK
- type ChannelConfig
- type Channels
- type Class
- func (class *Class) AddProperty(key string, value *validation.Config, options ...interface{})
- func (class *Class) Column(i int) (bool, *Property)
- func (class *Class) HasProperty(key string) (bool, *Property)
- func (class *Class) InsertColumns() Properties
- func (class *Class) Link(predicate string, classes ...*Class)
- func (class *Class) NewProperty(key string, value *validation.Config) *Property
- func (class *Class) NewVertex(x string, data map[string]interface{}) *Vertex
- func (class *Class) Table() string
- func (class *Class) Validation() *common.Payload
- type Classes
- type Client
- type Constraint
- type Constraints
- type Credentials
- type DEFAULT
- type Database
- func (db *Database) AddClass(name string) *Class
- func (db *Database) AddPredicate(name string) *Predicate
- func (db *Database) AddRelationship(relationship *Relationship)
- func (db *Database) ClassNameIndex(name string) *Class
- func (db *Database) ClassUidIndex(uid int64) *Class
- func (db *Database) ExportVertexList(list []*Vertex)
- func (db *Database) FindSession(token string) (bool, *Session)
- func (db *Database) GetPredicate(name string) *Predicate
- func (db *Database) GetVertex(uid int64) *Vertex
- func (db *Database) MOD_authenticate(req web.RequestInterface, arg interface{}) *web.ResponseStatus
- func (db *Database) MOD_createVertex(req web.RequestInterface, arg interface{}) *web.ResponseStatus
- func (db *Database) MOD_edgeState(req web.RequestInterface, arg interface{}) *web.ResponseStatus
- func (db *Database) MOD_getProperty(req web.RequestInterface, arg interface{}) *web.ResponseStatus
- func (db *Database) MOD_lookupVertex(req web.RequestInterface, arg interface{}) *web.ResponseStatus
- func (db *Database) MOD_return(req web.RequestInterface, arg interface{}) *web.ResponseStatus
- func (db *Database) SetPredicate(name string, predicate *Predicate)
- func (db *Database) SetVertex(vtx *Vertex)
- func (db *Database) Table(id string) string
- type Edge
- type EventClient
- type FOREIGN_KEY
- type InternalClasses
- type Link
- type NOT_NULL
- type NULL
- type NewVertex
- type PRIMARY_KEY
- type Predicate
- func (predicate *Predicate) Add(state *Link)
- func (predicate *Predicate) Init()
- func (predicate *Predicate) Insert_Edge(link *Link) bool
- func (predicate *Predicate) Insert_History(link *Link) bool
- func (predicate *Predicate) NewLink(inVertex *Vertex, outVertex *Vertex, s bool, ...) (bool, *Link)
- func (predicate *Predicate) PredicateService()
- func (predicate *Predicate) Sync() bool
- func (predicate *Predicate) SyncEdges(offset int64) bool
- func (predicate *Predicate) Traverse(uid int64, phase, export bool, limit int64) []*Vertex
- func (predicate *Predicate) TraverseCount(uid int64, phase bool) int64
- func (predicate *Predicate) TraverseEdges(uid int64, phase bool, limit int64) []*Link
- func (predicate *Predicate) Update_Properties(historyId int64, payload map[string]interface{}) bool
- type Properties
- type Property
- type PropertyExport
- type Relationship
- type Relationships
- type Session
- type StateIndex
- type UNIQUE
- type URL
- type User
- type Vector
- func (vector *Vector) Active(uid int64, phase bool, limit int64) []*Vertex
- func (vector *Vector) ActiveCount(uid int64) int64
- func (vector *Vector) ActiveEdges(uid int64, limit int64) []*Link
- func (vector *Vector) Add(state *Link)
- func (vector *Vector) Count() int64
- func (vector *Vector) SortOrder(uid int64)
- type Vertex
- func (vertex *Vertex) Delete() bool
- func (vertex *Vertex) GetProperty(key string) interface{}
- func (vertex *Vertex) InCount(predicateName string) int64
- func (vertex *Vertex) InList(predicateName string, export bool, limit int64) (bool, []*Vertex)
- func (vertex *Vertex) Insert() bool
- func (vertex *Vertex) LoadPayload(req web.RequestInterface) *web.ResponseStatus
- func (vertex *Vertex) LoadProperties(args ...string) bool
- func (vertex *Vertex) OutCount(predicateName string) int64
- func (vertex *Vertex) OutList(predicateName string, export bool, limit int64) (bool, []*Vertex)
- func (vertex *Vertex) Patch(props map[string]interface{}) bool
- func (vertex *Vertex) Properties(key string) map[string]interface{}
- func (vertex *Vertex) SaveData() bool
- func (vertex *Vertex) SetEdgeState(out *Vertex, predicateName string, state bool) bool
- func (vertex *Vertex) SetProperty(key string, value interface{})
- type VertexIndex
Constants ¶
View Source
const ( TABLE_CLASSES = "_classes" TABLE_VERTICES = "_vertices" TABLE_PROPERTIES = "_properties" TABLE_USERS = "_users" TABLE_SESSIONS = "_sessions" )
View Source
const ( SHORT_ID_BUF_LEN = 12 SESSION_KEY_LEN = 64 )
View Source
const ( SHA3_ID_LENGTH = 15 MAX_CLASS_NAME = 20 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AUTO_INCREMENT ¶
type AUTO_INCREMENT struct {
Val string
}
func (AUTO_INCREMENT) SQL ¶
func (c AUTO_INCREMENT) SQL() string
func (AUTO_INCREMENT) Value ¶
func (c AUTO_INCREMENT) Value() string
type ChannelConfig ¶
type ChannelConfig struct { Channel chan interface{} Listeners []*EventClient }
type Channels ¶
type Channels struct { EdgeState *ChannelConfig InsertVertex *ChannelConfig DeleteVertex *ChannelConfig UpdateVertex *ChannelConfig }
func (*Channels) ListenDeleteVertex ¶
func (c *Channels) ListenDeleteVertex(listener *EventClient)
func (*Channels) ListenEdgeState ¶
func (c *Channels) ListenEdgeState(listener *EventClient)
func (*Channels) ListenInsertVertex ¶
func (c *Channels) ListenInsertVertex(listener *EventClient)
func (*Channels) ListenUpdateVertex ¶
func (c *Channels) ListenUpdateVertex(listener *EventClient)
type Class ¶
type Class struct { // root schema DB *Database `json:"-"` // deterministic id Uid int64 // class name Name string // primary keys PKs []Constraint // foreign keys FKs map[string]Constraint // class schema Properties Properties PropertyMap map[string]*Property // gf node // Node *gf.Node // gf node // InstanceNode *gf.Node // is internal class IsUser bool IsAnchor bool Internal bool sync.RWMutex }
func (*Class) AddProperty ¶
func (class *Class) AddProperty(key string, value *validation.Config, options ...interface{})
func (*Class) InsertColumns ¶
func (class *Class) InsertColumns() Properties
func (*Class) NewProperty ¶
func (class *Class) NewProperty(key string, value *validation.Config) *Property
func (*Class) Validation ¶
type Classes ¶
type Client ¶
type Client interface { SetDB(*Database) // Exec(string, ...interface{}) (bool, sql.Result) CreateDatabase(string) bool InsertInternalTable(*Class) bool InsertClass(string) (bool, int64) InsertVertex(*Class, string) (bool, int64) InsertProperty(*Vertex, string, interface{}) bool DeleteVertex(int64) bool // QueryClassUID(string) (bool, int64) // QueryRows(string, ...interface{}) (bool, *sql.Rows) CountRows(string, ...interface{}) int64 // QueryUser(string, ...interface{}) (bool, *User) QuerySession(string, ...interface{}) (bool, *Session) // QueryVertex(int64) (bool, *Vertex) QueryVertexByX(string, ...*Class) (bool, *Vertex) QueryVertices(string, ...interface{}) (bool, []*Vertex) // QueryEdge(*Predicate, string, ...interface{}) (bool, *Link) QueryEdges(*Predicate, string, ...interface{}) (bool, []*Link) QueryAllEdges(*Predicate) (bool, []*Link) CountAllEdges(*Predicate) int64 // QueryLink(string, ...interface{}) (bool, *Link) QueryLinks(string, ...interface{}) (bool, []*Link) // SearchClassProperties(*Class, string, string) (bool, []*PropertyExport) SearchProperties(string, string) (bool, []interface{}) QueryProperties(*Vertex, ...string) (bool, map[string]interface{}) // QueryState(*Vertex, *Vertex, *Predicate, bool) bool QueryClassCount(*Class) int64 QueryClassList(*Class, int64, int64) (bool, []*Vertex) // in QueryInCount(*Predicate, *Vertex) int64 QueryInList(*Predicate, *Vertex, int64) (bool, []*Vertex) QueryInClassCount(*Class, *Predicate, *Vertex) int64 QueryInClassList(*Class, *Predicate, *Vertex, int64, int64) (bool, []*Vertex) // out QueryOutCount(*Predicate, *Vertex) int64 QueryOutList(*Predicate, *Vertex, int64) (bool, []*Vertex) QueryOutClassCount(*Class, *Predicate, *Vertex) int64 QueryOutClassList(*Class, *Predicate, *Vertex, int64, int64) (bool, []*Vertex) // TraverseEdges(int64, *Predicate, bool, int64) (bool, []*Link) Traverse(int64, *Predicate, bool, bool, int64) (bool, []*Vertex) TraverseCount(int64, *Predicate, bool) int64 }
type Constraint ¶
type Constraints ¶
type Constraints struct { PRIMARY_KEY PRIMARY_KEY FOREIGN_KEY FOREIGN_KEY NOT_NULL NOT_NULL DEFAULT DEFAULT UNIQUE UNIQUE CHECK CHECK }
func (*Constraints) List ¶
func (c *Constraints) List() []Constraint
type Credentials ¶
type Database ¶
type Database struct { // logging interface Log logging.Logger // database name Name string // database client Client Client // custom classes Classes *Classes // class representing user UserClass *Class // callback channels Channels Channels MemGraph bool sync.RWMutex // contains filtered or unexported fields }
func NewDatabase ¶
func (*Database) AddPredicate ¶
func (*Database) AddRelationship ¶
func (db *Database) AddRelationship(relationship *Relationship)
func (*Database) ClassNameIndex ¶
func (*Database) ClassUidIndex ¶
func (*Database) ExportVertexList ¶
func (*Database) GetPredicate ¶
func (*Database) MOD_authenticate ¶
func (db *Database) MOD_authenticate(req web.RequestInterface, arg interface{}) *web.ResponseStatus
func (*Database) MOD_createVertex ¶
func (db *Database) MOD_createVertex(req web.RequestInterface, arg interface{}) *web.ResponseStatus
func (*Database) MOD_edgeState ¶
func (db *Database) MOD_edgeState(req web.RequestInterface, arg interface{}) *web.ResponseStatus
func (*Database) MOD_getProperty ¶
func (db *Database) MOD_getProperty(req web.RequestInterface, arg interface{}) *web.ResponseStatus
func (*Database) MOD_lookupVertex ¶
func (db *Database) MOD_lookupVertex(req web.RequestInterface, arg interface{}) *web.ResponseStatus
func (*Database) MOD_return ¶
func (db *Database) MOD_return(req web.RequestInterface, arg interface{}) *web.ResponseStatus
func (*Database) SetPredicate ¶
type EventClient ¶
type FOREIGN_KEY ¶
type FOREIGN_KEY struct {
Val string
}
func (FOREIGN_KEY) SQL ¶
func (c FOREIGN_KEY) SQL() string
func (FOREIGN_KEY) Value ¶
func (c FOREIGN_KEY) Value() string
type InternalClasses ¶
type InternalClasses struct { Constraints Constraints // contains filtered or unexported fields }
type Link ¶
type Link struct { Predicate *Predicate `json:"-"` // history uid Uid int64 // edge id Id string // in I *Vertex Iuid int64 Iclass int64 // out O *Vertex Ouid int64 Oclass int64 // state State bool // update timestamp M time.Time // number of props H int64 // Props int // sync.RWMutex }
func (*Link) LoadVertex ¶
type PRIMARY_KEY ¶
type PRIMARY_KEY struct {
Val string
}
func (PRIMARY_KEY) SQL ¶
func (c PRIMARY_KEY) SQL() string
func (PRIMARY_KEY) Value ¶
func (c PRIMARY_KEY) Value() string
type Predicate ¶
type Predicate struct { DB *Database `json:"-"` Name string Edges *Class History *Class Properties *Class Initialized bool In *Vector Out *Vector sync.RWMutex // contains filtered or unexported fields }
func (*Predicate) Insert_Edge ¶
func (*Predicate) Insert_History ¶
func (*Predicate) PredicateService ¶
func (predicate *Predicate) PredicateService()
func (*Predicate) TraverseCount ¶
func (*Predicate) TraverseEdges ¶
type Properties ¶
type Properties []*Property
func (Properties) Keys ¶
func (properties Properties) Keys() []string
type Property ¶
type Property struct { // root schema DB *Database `json:"-"` // vertex uid Vertex int64 // name of this field Key string // arbitrary value Value *validation.Config // max length for strings Max int // is primary key Constraints map[Constraint]bool `json:"-"` sync.RWMutex }
func (*Property) SQL_Datatype ¶
type PropertyExport ¶
type Relationship ¶
type Relationships ¶
type Relationships []*Relationship
type StateIndex ¶
type User ¶
type User struct { DB *Database `json:"-"` Uid int64 Name string PasswordHash string Vertex *Vertex }
func (*User) NewSession ¶
type Vector ¶
func (*Vector) ActiveCount ¶
type Vertex ¶
type Vertex struct { DB *Database `json:"-"` Class *Class `json:"-"` Uid int64 X string Data map[string]interface{} sync.RWMutex }
func (*Vertex) GetProperty ¶
func (*Vertex) LoadPayload ¶
func (vertex *Vertex) LoadPayload(req web.RequestInterface) *web.ResponseStatus
func (*Vertex) LoadProperties ¶
func (*Vertex) Properties ¶
func (*Vertex) SetEdgeState ¶
updates a state of a link between two vertices
func (*Vertex) SetProperty ¶
type VertexIndex ¶
func (VertexIndex) New ¶
func (vi VertexIndex) New() *VertexIndex
Source Files ¶
- channels.go
- class.go
- classes.go
- client.go
- const.go
- constraint.go
- credentials.go
- crypto.go
- database.go
- events.go
- global.go
- internal.go
- link.go
- modules.go
- predicate.go
- predicateService.go
- property.go
- relationship.go
- session.go
- tables.go
- traverse.go
- user.go
- vector.go
- vertex.go
- vertexIndex.go
- vertex_ops.go
Click to show internal directories.
Click to hide internal directories.