Documentation ¶
Overview ¶
Package backendgeoip defines the backend configuration options and element slices.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConfigStructure ¶
NewConfigStructure global configuration structure for this package. Used in frontend (to display the user all the settings) and in backend (scope checks and default values). See the source code of this function for the overall available sections, groups and fields.
Types ¶
type Configuration ¶
type Configuration struct { *geoip.OptionFactories // AllowedCountries list of countries which are currently allowed. // Separated via comma, e.g.: DE,CH,AT,AU,NZ, // // Path: net/geoip/allowed_countries AllowedCountries cfgmodel.StringCSV // AlternativeRedirect redirects the client to this URL if their // country hasn't been granted access to the next middleware handler. // // Path: net/geoip/alternative_redirect AlternativeRedirect cfgmodel.URL // AlternativeRedirectCode HTTP redirect code. // // Path: net/geoip/alternative_redirect_code AlternativeRedirectCode cfgmodel.Int // DataSource defines to either load the Geo location data from a MaxMind // "file" or from the MaxMind "webservice". // // Path: net/geoip_maxmind/data_source DataSource cfgmodel.Str // MaxmindLocalFile path to a file name stored on the server. // // Path: net/geoip_maxmind/local_file MaxmindLocalFile cfgmodel.Str // MaxmindWebserviceUserID user id // // Path: net/geoip_maxmind/webservice_userid MaxmindWebserviceUserID cfgmodel.Str // MaxmindWebserviceLicense license name // // Path: net/geoip_maxmind/webservice_license MaxmindWebserviceLicense cfgmodel.Str // MaxmindWebserviceTimeout HTTP request time out // // Path: net/geoip_maxmind/webservice_timeout MaxmindWebserviceTimeout cfgmodel.Duration // MaxmindWebserviceRedisURL an URL to the Redis server // // Path: net/geoip_maxmind/webservice_redisurl MaxmindWebserviceRedisURL cfgmodel.URL }
Configuration just exported for the sake of documentation. See fields for more information.
func New ¶
func New(cfgStruct element.Sections, opts ...cfgmodel.Option) *Configuration
New initializes the backend configuration models containing the cfgpath.Route variable to the appropriate entries. The function Load() will be executed to apply the Sections to all models. See Load() for more details.
func (*Configuration) PrepareOptionFactory ¶
func (be *Configuration) PrepareOptionFactory() geoip.OptionFactoryFunc
PrepareOptionFactory creates a closure around the type Backend. The closure will be used during a scoped request to figure out the configuration depending on the incoming scope. An option array will be returned by the closure.