localisation

package
v0.0.0-...-13f918f Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractCityFromID

func ExtractCityFromID(id string) string

ExtractCityFromID is backwards compatible version of ExtractHobFromID

func ExtractHobFromID

func ExtractHobFromID(id string) string

ExtractHobFromID takes an ID of the form LON1234 and returns LON

func HobRoleAuthoriser

func HobRoleAuthoriser(roles []string, hobDiscriminator HobDiscriminator) server.Authoriser

HobRoleAuthoriser requires a service or user calling an endpoint to have ANY of the roles passed, which will be scoped to a particular HOB (as determined by hobDiscriminator). Following the convention of a HOB being the last portion of a role, the matched role(s) will be of the form "{{ role }}.{{ HOB }}" (or just "{{ role }}" if the hobDiscriminator returns "").

func SignInHobRoleAuthoriser

func SignInHobRoleAuthoriser(roles []string, hobDiscriminator HobDiscriminator) server.Authoriser

SignInHobRoleAuthoriser requires a real person signed in calling an endpoint to have ANY of the passed roles, which will be scoped to a particular HOB (as determined by hobDiscriminator). Following the convention of a HOB being the last portion of a role, the matched role(s) will be of the form "{{ role }}.{{ HOB }}" (or just "{{ role }}" if the hobDiscriminator returns "").

Types

type HobDiscriminator

type HobDiscriminator func(req *server.Request) (hob string)

HobDiscriminator defines a function that can determine a HOB for a given server request. If no HOB can be determined, an empty string should be returned.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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