Documentation ¶
Overview ¶
Copyright (c) 2014 André Luiz Alves Moraes
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data holds the implementation of the postgresql backend
Index ¶
- Constants
- type Db
- type Keyword
- type Node
- type Querier
- type Relation
- type RelationSet
- type Repo
- func (r *Repo) AbortPending() error
- func (r *Repo) ActiveQuerier() Querier
- func (r *Repo) Begin() bool
- func (r *Repo) Close() error
- func (nr *Repo) Connect(user, password, dbname, host string) error
- func (nr *Repo) Create() error
- func (nr *Repo) DeleteAll() error
- func (nr *Repo) Drop() error
- func (r *Repo) End() error
- func (r *Repo) Err() error
- func (nr *Repo) FetchNode(name string, gid uint64, out *Node) error
- func (r *Repo) FetchRelation(from, to uint64, name string, out *Relation) error
- func (nr *Repo) Keyword(id interface{}, out *Keyword) error
- func (nr *Repo) SaveKeyword(kw *Keyword) error
- func (nr *Repo) SaveNode(node *Node) error
- func (r *Repo) SaveRelation(rel *Relation) error
- func (r *Repo) Walk(from uint64, name string, out RelationSet) (RelationSet, error)
- type Transaction
Constants ¶
const ( InvalidGid = uint64(0) InvalidKid = uint32(0) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Relation ¶
type Relation struct { FromGid uint64 FromName string FromAttributes string ToGid uint64 ToName string ToAttributes string Attributes string Field uint32 Name string }
func (*Relation) CopyFromData ¶
func (*Relation) CopyToData ¶
type RelationSet ¶
type RelationSet []*Relation
func (*RelationSet) Push ¶
func (r *RelationSet) Push(rel *Relation)
type Repo ¶
type Repo struct { Db Db Transaction Transaction AutoCommit bool // contains filtered or unexported fields }
func (*Repo) AbortPending ¶
func (*Repo) ActiveQuerier ¶
func (*Repo) DeleteAll ¶
DeleteAll remove all nodes and relations from the database but keep all keywords
func (*Repo) FetchRelation ¶
func (*Repo) SaveKeyword ¶
func (*Repo) SaveRelation ¶
func (*Repo) Walk ¶
func (r *Repo) Walk(from uint64, name string, out RelationSet) (RelationSet, error)