Documentation ¶
Index ¶
- Variables
- func BuildInfoHandler(w http.ResponseWriter, req *http.Request)
- func Checker() (string, error)
- func GetPerson(w http.ResponseWriter, r *http.Request)
- func GoodToGo(writer http.ResponseWriter, req *http.Request)
- func HealthCheck() v1a.Check
- func MethodNotAllowedHandler(w http.ResponseWriter, r *http.Request)
- func Ping(w http.ResponseWriter, r *http.Request)
- type ChangeEvent
- type CypherDriver
- type Driver
- type Membership
- type Organisation
- type Person
- type Role
- type Thing
Constants ¶
This section is empty.
Variables ¶
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 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 MethodNotAllowedHandler ¶
func MethodNotAllowedHandler(w http.ResponseWriter, r *http.Request)
MethodNotAllowedHandler handles 405
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
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