Documentation ¶
Index ¶
- Variables
- func HandleCountries(renderer Renderer) http.Handler
- func HandleCountry(renderer Renderer, repo db.CountryRepo) http.Handler
- func HandleDownload(userRepo db.IndividualRepo, azureStorageClient *azblob.Client, ...) http.Handler
- func HandleHealth(healthzRepo db.HealthzRepo) http.Handler
- func HandleHome(renderer Renderer) http.Handler
- func HandleIndividual(renderer Renderer, repo db.IndividualRepo) http.Handler
- func HandleIndividualAction(repo db.IndividualRepo, action string) http.Handler
- func HandleIndividuals(renderer Renderer, repo db.IndividualRepo) http.Handler
- func HandleIndividualsAction(renderer Renderer, repo db.IndividualRepo, action string) http.Handler
- func HandleUpload(renderer Renderer, individualRepo db.IndividualRepo) http.Handler
- type Renderer
- type RequestContext
- type ViewData
- func (v ViewData) Error(field string) string
- func (v ViewData) ErrorsKey() string
- func (v ViewData) GetErrors() validation.ValidationErrors
- func (v ViewData) HasError(field string) bool
- func (v ViewData) HasErrors() bool
- func (v ViewData) RequestContext() RequestContext
- func (v ViewData) RequestContextKey() string
Constants ¶
This section is empty.
Variables ¶
View Source
var UPLOAD_LIMIT = 10000
Functions ¶
func HandleCountries ¶
func HandleCountry ¶
func HandleCountry(renderer Renderer, repo db.CountryRepo) http.Handler
func HandleDownload ¶
func HandleHealth ¶
func HandleHealth(healthzRepo db.HealthzRepo) http.Handler
func HandleHome ¶
func HandleIndividual ¶
func HandleIndividual(renderer Renderer, repo db.IndividualRepo) http.Handler
func HandleIndividualAction ¶
func HandleIndividualAction(repo db.IndividualRepo, action string) http.Handler
func HandleIndividuals ¶
func HandleIndividuals(renderer Renderer, repo db.IndividualRepo) http.Handler
func HandleIndividualsAction ¶
func HandleUpload ¶
func HandleUpload(renderer Renderer, individualRepo db.IndividualRepo) http.Handler
Types ¶
type Renderer ¶
type Renderer interface {
RenderView(w http.ResponseWriter, r *http.Request, templateName string, data viewParams)
}
type RequestContext ¶
type RequestContext struct { // Request is the http request Request *http.Request // Auth is the auth.Interface Auth auth.Interface // Countries is the list of all countries Countries []*api.Country // SelectedCountry is the selected country. May be nil SelectedCountry *api.Country // Session is the current user session Session auth.Session // AvailableLocales is a list of the available locales AvailableLocales map[string]string // turn on dev features EnableBetaFeatures bool }
RequestContext encapsulates useful information about the current request.
func (RequestContext) HasSelectedCountryReadPermission ¶
func (r RequestContext) HasSelectedCountryReadPermission() bool
func (RequestContext) HasSelectedCountryWritePermission ¶
func (r RequestContext) HasSelectedCountryWritePermission() bool
func (RequestContext) SelectedCountryID ¶
func (r RequestContext) SelectedCountryID() string
type ViewData ¶
type ViewData map[string]interface{}
ViewData is a map of key/value pairs that can be used to render a view. We can add methods to this type to make it more useful when rendering views.
func (ViewData) GetErrors ¶
func (v ViewData) GetErrors() validation.ValidationErrors
GetErrors returns a map of field names to error messages.
func (ViewData) RequestContext ¶
func (v ViewData) RequestContext() RequestContext
RequestContext returns the request context for the current request.
func (ViewData) RequestContextKey ¶
RequestContextKey returns the key for the request context in the view data.
Click to show internal directories.
Click to hide internal directories.