Documentation ¶
Index ¶
Constants ¶
View Source
const ValidationTimeFormat = "2006-01-02T15:04:05Z07:00"
The time format to use when adding the validation time to the response.
Variables ¶
This section is empty.
Functions ¶
func AddHandlers ¶
func AddHandlers( settingsFile string, swanAccess access.Access, malformedHandler func(w http.ResponseWriter, r *http.Request)) error
AddHandlers adds swift and owid end points configured from the JSON file provided. settingsFile path to the file that contains the configuration settings. swanAccess an authorization instance used to valid requests. malformedHandler if SWAN can't handle the request the handler to use instead.
Types ¶
type Configuration ¶
type Configuration struct { Scheme string `json:"scheme"` // The scheme to use for requests Debug bool `json:"debug"` // Seconds until the value provided should be revalidated RevalidateSeconds int `json:"revalidateSeconds"` // The number of days after which the data will automatically be removed // from SWAN and will need to be provided again by the user. DeleteDays int `json:"deleteDays"` }
Configuration maps to the appsettings.json settings file.
func (*Configuration) DeleteDate ¶
func (c *Configuration) DeleteDate() time.Time
Gets the delete date for the SWAN data. This is the data after which the date will be removed from the network. Users will have to re-enter the data after this time.
func (*Configuration) RevalidateSecondsDuration ¶
func (c *Configuration) RevalidateSecondsDuration() time.Duration
RevalidateSecondsDuration in seconds as a time.Duration
Click to show internal directories.
Click to hide internal directories.