Documentation
¶
Index ¶
- func EntityKindStringFromProto(e *npb.Entity) string
- func ReadFragmentFiles(fragmentFilenames []string) (*npb.Fragment, error)
- type Collection
- func (erColl *Collection) EntityExists(key string) bool
- func (erColl *Collection) InsertEntity(entity *npb.Entity) error
- func (erColl *Collection) InsertRelationship(r Relationship) error
- func (erColl *Collection) InsertRelationshipProto(relationship *npb.Relationship) error
- func (erColl *Collection) NumEntities() int
- func (erColl *Collection) NumRelationships() int
- type CollectionBuilder
- type Relationship
- type RelationshipSet
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Collection ¶
type Collection struct {
Entities map[string]*npb.Entity
OutEdges map[string]*RelationshipSet
InEdges map[string]*RelationshipSet
}
func NewCollection ¶
func NewCollection() *Collection
func (*Collection) EntityExists ¶
func (erColl *Collection) EntityExists(key string) bool
func (*Collection) InsertEntity ¶
func (erColl *Collection) InsertEntity(entity *npb.Entity) error
func (*Collection) InsertRelationship ¶
func (erColl *Collection) InsertRelationship(r Relationship) error
func (*Collection) InsertRelationshipProto ¶
func (erColl *Collection) InsertRelationshipProto(relationship *npb.Relationship) error
func (*Collection) NumEntities ¶
func (erColl *Collection) NumEntities() int
func (*Collection) NumRelationships ¶
func (erColl *Collection) NumRelationships() int
type CollectionBuilder ¶
type CollectionBuilder struct {
// contains filtered or unexported fields
}
func NewCollectionBuilder ¶
func NewCollectionBuilder(v Validator) *CollectionBuilder
func NewNonValidatingCollectionBuilder ¶
func NewNonValidatingCollectionBuilder() *CollectionBuilder
func (*CollectionBuilder) Build ¶
func (builder *CollectionBuilder) Build() (*Collection, error)
func (*CollectionBuilder) InsertFragments ¶
func (builder *CollectionBuilder) InsertFragments(fragments ...*npb.Fragment) error
type Relationship ¶
func RelationshipFromProto ¶
func RelationshipFromProto(r *npb.Relationship) Relationship
func (*Relationship) String ¶
func (r *Relationship) String() string
type RelationshipSet ¶
type RelationshipSet struct {
Relations map[Relationship]struct{}
}
func NewRelationshipSet ¶
func NewRelationshipSet() *RelationshipSet
func (*RelationshipSet) Insert ¶
func (rset *RelationshipSet) Insert(r Relationship) error
type Validator ¶
type Validator interface {
// Validate each entity as it's loaded within the collection context
// assembled up to that point.
ValidateEntity(*Collection, *npb.Entity) error
// Validate each relationship as it's loaded within the collection
// context assembled up to that point.
ValidateRelationship(*Collection, Relationship) error
// Validate the complete collection.
ValidateCollection(*Collection) error
}
Click to show internal directories.
Click to hide internal directories.