Move iterators into separate package

Also reduce API exposure and use standard library more - and fix bugs I
previously introduces in mongo.
This commit is contained in:
kortschak 2014-06-30 22:22:50 +09:30
parent 88be6bee37
commit 1768e593a8
62 changed files with 3240 additions and 3130 deletions

View file

@ -45,14 +45,6 @@ type Triple struct {
Provenance string `json:"provenance,omitempty"`
}
func NewTriple() *Triple {
return &Triple{}
}
func MakeTriple(sub string, pred string, obj string, provenance string) *Triple {
return &Triple{sub, pred, obj, provenance}
}
// Direction specifies an edge's type.
type Direction byte
@ -103,7 +95,7 @@ func (t *Triple) Equals(o *Triple) bool {
}
// Pretty-prints a triple.
func (t *Triple) ToString() string {
func (t *Triple) String() string {
return fmt.Sprintf("%s -- %s -> %s\n", t.Subject, t.Predicate, t.Object)
}