Documentation ¶
Index ¶
- Variables
- func EscapeString(s string) string
- func InitDatabase(dbURI, dbUser, dbPassword string) neo4j.DriverWithContext
- func VerifyString(s string) error
- type Person
- func (p *Person) CreatePerson(driver neo4j.DriverWithContext) (*neo4j.Record, error)
- func (p *Person) DeletePerson(driver neo4j.DriverWithContext) error
- func (p *Person) ToString() string
- func (p *Person) UpdatePerson(driver neo4j.DriverWithContext) (*neo4j.Record, error)
- func (p *Person) Verify() error
- type Relationship
- func (r *Relationship) CreateRelationship(driver neo4j.DriverWithContext) (*neo4j.Record, error)
- func (r *Relationship) DeleteRelationship(driver neo4j.DriverWithContext) error
- func (r *Relationship) Verify() error
- func (r *Relationship) VerifyRelationship(driver neo4j.DriverWithContext) (*neo4j.Record, error)
- type RelationshipAndPerson
Constants ¶
This section is empty.
Variables ¶
View Source
var RelationshipTypes = []string{
"Parent",
"Child",
"Spouse",
"Sibling",
}
Functions ¶
func EscapeString ¶
EscapeString escapes delimiters in a string to prevent cypher injection
func InitDatabase ¶
func InitDatabase(dbURI, dbUser, dbPassword string) neo4j.DriverWithContext
func VerifyString ¶
VerifyString verifies if a string is valid and does not contain cypher injection
Types ¶
type Person ¶
type Person struct { ID string `json:"id"` Firstname string `json:"first_name"` Middlename string `json:"middle_name"` Lastname string `json:"last_name"` Titles []string `json:"titles"` // e.g. Jr., Sr., III Suffixes []string `json:"suffixes"` // e.g. Ph.D., M.D. ExtraNames []string `json:"extra_names"` Aliases []string `json:"aliases"` MothersFirstname string `json:"mothers_first_name"` MothersLastname string `json:"mothers_last_name"` Born time.Time `json:"born"` Birthplace string `json:"birthplace"` Residence string `json:"residence"` Death time.Time `json:"death"` Deathplace string `json:"deathplace"` LifeEvents []map[string]string `json:"life_events"` Occupations []string `json:"occupation"` OccupationToDisplay string `json:"occupation_to_display"` OthersSaid map[string]string `json:"others_said"` Photos map[string]string `json:"photos"` ProfilePicture string `json:"profile_picture"` // contains filtered or unexported fields }
func (*Person) CreatePerson ¶
func (*Person) DeletePerson ¶
func (p *Person) DeletePerson(driver neo4j.DriverWithContext) error
func (*Person) UpdatePerson ¶
type Relationship ¶
type Relationship struct { FirstPersonID string `json:"first_person_id"` SecondPersonID string `json:"second_person_id"` Relationship string `json:"relationship"` Direction string `json:"direction"` }
func (*Relationship) CreateRelationship ¶
func (r *Relationship) CreateRelationship(driver neo4j.DriverWithContext) (*neo4j.Record, error)
func (*Relationship) DeleteRelationship ¶
func (r *Relationship) DeleteRelationship(driver neo4j.DriverWithContext) error
func (*Relationship) Verify ¶
func (r *Relationship) Verify() error
Verify checks if the relationship is valid and does not contain cypher injection
func (*Relationship) VerifyRelationship ¶
func (r *Relationship) VerifyRelationship(driver neo4j.DriverWithContext) (*neo4j.Record, error)
type RelationshipAndPerson ¶
type RelationshipAndPerson struct { Relationship Relationship `json:"relationship"` Person Person `json:"person"` }
func (*RelationshipAndPerson) CreateRelationshipAndPerson ¶
func (rp *RelationshipAndPerson) CreateRelationshipAndPerson(driver neo4j.DriverWithContext) (*neo4j.Record, error)
func (*RelationshipAndPerson) Verify ¶
func (r *RelationshipAndPerson) Verify() error
Click to show internal directories.
Click to hide internal directories.