people

package
Version: v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2016 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CacheControlHeader string

Functions

func BuildInfoHandler

func BuildInfoHandler(w http.ResponseWriter, req *http.Request)

BuildInfoHandler - This is a stop gap and will be added to when we can define what we should display here

func Checker

func Checker() (string, error)

Checker does more stuff

func GetPerson

func GetPerson(w http.ResponseWriter, r *http.Request)

GetPerson is the public API

func GoodToGo

func GoodToGo(writer http.ResponseWriter, req *http.Request)

GoodToGo returns a 503 if the healthcheck fails - suitable for use from varnish to check availability of a node

func HealthCheck

func HealthCheck() v1a.Check

HealthCheck does something

func MethodNotAllowedHandler

func MethodNotAllowedHandler(w http.ResponseWriter, r *http.Request)

MethodNotAllowedHandler handles 405

func Ping

func Ping(w http.ResponseWriter, r *http.Request)

Ping says pong

Types

type ChangeEvent

type ChangeEvent struct {
	StartedAt string `json:"startedAt,omitempty"`
	EndedAt   string `json:"endedAt,omitempty"`
}

ChangeEvent represent when something started or ended

type CypherDriver

type CypherDriver struct {
	// contains filtered or unexported fields
}

CypherDriver struct

func NewCypherDriver

func NewCypherDriver(conn neoutils.NeoConnection, env string) CypherDriver

NewCypherDriver instantiate driver

func (CypherDriver) CheckConnectivity

func (pcw CypherDriver) CheckConnectivity() error

CheckConnectivity tests neo4j by running a simple cypher query

func (CypherDriver) Read

func (pcw CypherDriver) Read(uuid uuid.UUID) (person Person, found bool, err error)

type Driver

type Driver interface {
	Read(id uuid.UUID) (person Person, found bool, err error)
	CheckConnectivity() error
}

Driver interface

var PeopleDriver Driver

PeopleDriver for cypher queries

type Membership

type Membership struct {
	Title        string         `json:"title,omitempty"`
	Organisation Organisation   `json:"organisation"`
	ChangeEvents *[]ChangeEvent `json:"changeEvents,omitempty"`
	Roles        []Role         `json:"roles"`
}

Membership represents the relationship between a person and their roles associated with an organisation

type Organisation

type Organisation struct {
	*Thing
	Types  []string  `json:"types"`
	Labels *[]string `json:"labels,omitempty"`
}

Organisation simplified representation used in Person API

type Person

type Person struct {
	*Thing
	Types          []string     `json:"types"`
	Labels         *[]string    `json:"labels,omitempty"`
	Memberships    []Membership `json:"memberships,omitempty"`
	Salutation     string       `json:"salutation,omitempty"`
	BirthYear      int          `json:"birthYear,omitempty"`
	EmailAddress   string       `json:"emailAddress,omitempty"`
	TwitterHandle  string       `json:"twitterHandle,omitempty"`
	Description    string       `json:"description,omitempty"`
	DescriptionXML string       `json:"descriptionXML,omitempty"`
	ImageURL       string       `json:"_imageUrl,omitempty"` // TODO this is a temporary thing - needs to be integrated into images properly
}

Person is the structure used for the people API

type Role

type Role struct {
	*Thing
	ChangeEvents *[]ChangeEvent `json:"changeEvents,omitempty"`
}

Role represents the capacity or funciton that a person performs for an organisation

type Thing

type Thing struct {
	ID        string `json:"id"`
	APIURL    string `json:"apiUrl"` // self ?
	PrefLabel string `json:"prefLabel,omitempty"`
}

Thing is the base entity, all nodes in neo4j should have these properties

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL