GA/UserVoice opt-in
This commit is contained in:
@ -153,12 +153,16 @@ func (s *Server) previewHandler(w http.ResponseWriter, r *http.Request) {
|
||||
Filename string
|
||||
Url string
|
||||
ContentLength uint64
|
||||
GAKey string
|
||||
UserVoiceKey string
|
||||
}{
|
||||
contentType,
|
||||
content,
|
||||
filename,
|
||||
r.URL.String(),
|
||||
contentLength,
|
||||
s.gaKey,
|
||||
s.userVoiceKey,
|
||||
}
|
||||
|
||||
if err := htmlTemplates.ExecuteTemplate(w, templatePath, data); err != nil {
|
||||
|
@ -82,6 +82,18 @@ func Listener(s string) OptionFn {
|
||||
|
||||
}
|
||||
|
||||
func GoogleAnalytics(gaKey string) OptionFn {
|
||||
return func(srvr *Server) {
|
||||
srvr.gaKey = gaKey
|
||||
}
|
||||
}
|
||||
|
||||
func UserVoice(userVoiceKey string) OptionFn {
|
||||
return func(srvr *Server) {
|
||||
srvr.userVoiceKey = userVoiceKey
|
||||
}
|
||||
}
|
||||
|
||||
func TLSListener(s string) OptionFn {
|
||||
return func(srvr *Server) {
|
||||
srvr.TLSListenerString = s
|
||||
@ -210,7 +222,9 @@ type Server struct {
|
||||
|
||||
tempPath string
|
||||
|
||||
webPath string
|
||||
webPath string
|
||||
gaKey string
|
||||
userVoiceKey string
|
||||
|
||||
ListenerString string
|
||||
TLSListenerString string
|
||||
|
Reference in New Issue
Block a user